Skip to content

Feature Request: Support ClusterLabels for namespaceLabels in fleet.yaml #4140

@cloudkarthik99

Description

@cloudkarthik99

Is your feature request related to a problem?

Hello,
I am trying to add clusterLabels to the namespaceLabels, but it is not supported.

defaultNamespace: edns-system
namespaceLabels:
  product: test
  segment: dns
  team: alpha
  env: "${ .ClusterLabels.environment }"   <----# Dev, prod

helm:
  repo: https://kubernetes-sigs.github.io/external-dns
  chart: external-dns
  version: "1.12.1"
  releaseName: external-dns
  valuesFiles:
    - values.yaml

Facing the below error here:

Namespace "edns-system" is invalid: metadata.labels: Invalid value: "${ .ClusterLabels.environment }": a valid label must be an empty string or consist of alphanumeric characters, '-', '' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9.]*)?[A-Za-z0-9])?')

Solution you'd like

No response

Alternatives you've considered

The alternatives I tried after checking from the doc didnt work either:

helm:
  repo: https://kubernetes-sigs.github.io/external-dns
  chart: external-dns
  version: "1.12.1"
  releaseName: external-dns
  valuesFiles:
    - values.yaml
  values:
    env: global.fleet.clusterLabels.environment
    region: global.fleet.clusterLabels.region

But I guess this option to pass the labels is for Deployments and not the namespace?

Anything else?

FYI, the labels such as environment and region does exists at the cluster level too.
Please provide any workaround that I can try to add the clusterLabels to the namespaceLabels.

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    🆕 New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions