Skip to content

Discussion: Global Variables #920

@ellistarn

Description

@ellistarn

Feature Description

Problem Statement:
Kubernetes clusters contain global state, such as Cluster Name, Kubernetes Version, Network CIDRs, etc. This state would be broadly useful for RGD authors to reduce undifferentiated parameterization of their APIs.

For example, ACK/EKS requires cluster name in the spec when configuring a PodIdentity resource. This introduces needless complexity for RGD authors who aim to distribute the same configurations across clusters -- clusterName must be parameterized. This pattern occurs broadly in the Kubernetes ecosystem, e.g. Karpenter's SubnetSelector and SecurityGroupSelector or any Helm Chart that changes behavior based on Kubernetes Version

One design path to achieve this would be to configure the KRO process with a set of environment variables (i.e. KRO_GLOBAL_XXX) that are automatically injected into the CEL runtime. They could be validated by the RGD validator to avoid misbehavior when values are not defined. When KRO is restarted with new variables, the changes would be propagated through the graph. Platforms that provide KRO as a service (e.g. EKS) could inject arbitrary domain specific globals that are relevant to their domain.

Open questions

  1. When should data be a variable be a Global vs sourced from an ExternalRef?
  2. How much type flexibility might we want in globals (e.g. lists/structs)?
  • Please vote on this issue by adding a 👍 reaction to the original issue
  • If you are interested in working on this feature, please leave a comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.needs-kreptriage/acceptedIndicates an issue or PR is ready to be actively worked on.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions