You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Many organisations require a standard set of labels on every Kubernetes resource, for cost allocation, ownership/asset tracking, and policy enforcement (OPA/Kyverno rules that reject unlabelled resources). Today the chart makes this impossible without post-rendering or forking:
extraLabels is only supported on a handful of resources: server.extraLabels, injector.extraLabels, server.serviceAccount.extraLabels, csi.daemonSet.extraLabels, csi.pod.extraLabels, and csi.serviceAccount.extraLabels.
All other resources; Services, ConfigMaps, Ingress/Route/HTTPRoute, RBAC objects, the MutatingWebhookConfiguration, PodDisruptionBudgets, NetworkPolicies, Secrets, PSPs, ServiceMonitor/PrometheusRule, accept no custom labels at all.
There is a long tail of open issues and PRs each attacking one slice of this problem (see "Additional context"), but no chart-wide solution.
Describe the solution you'd like
A single chart-wide values entry e.g. global.extraLabels (or commonLabels) merged into metadata.labels of every resource the chart renders, including pod templates. This is a well-established pattern in other popular charts (kube-prometheus-stack commonLabels, ingress-nginx commonLabels, Bitnami's commonLabels, cert-manager global.commonLabels).
Set app.kubernetes.io/version: {{ .Chart.AppVersion }} as part of the standard labels on all resources.
To keep upgrades safe, the common labels should be added to metadata.labels and pod template labels only, not to spec.selector/matchLabels, which are immutable on existing StatefulSets/Deployments.
Existing per-resource extraLabels values would keep working as more specific overrides, so the change is fully backwards-compatible.
Describe alternatives you've considered
Post-rendering with Kustomize: works, but pushes complexity onto every consumer of the chart and breaks the plain helm install/upgrade workflow.
Is your feature request related to a problem? Please describe.
Many organisations require a standard set of labels on every Kubernetes resource, for cost allocation, ownership/asset tracking, and policy enforcement (OPA/Kyverno rules that reject unlabelled resources). Today the chart makes this impossible without post-rendering or forking:
extraLabelsis only supported on a handful of resources:server.extraLabels,injector.extraLabels,server.serviceAccount.extraLabels,csi.daemonSet.extraLabels,csi.pod.extraLabels, andcsi.serviceAccount.extraLabels.server.extraLabelsis applied only to the pod template, not to the StatefulSet's ownmetadata.labels(server.extraLabels missing on statefulset #911, Ability to have top level label on StatefullSet #992).app.kubernetes.io/version, despite it being one of the Kubernetes recommended labels, and the standard labels it does set are applied inconsistently across templates (see fix: add missing helm.sh/chart labels #1183 for missinghelm.sh/chartlabels).There is a long tail of open issues and PRs each attacking one slice of this problem (see "Additional context"), but no chart-wide solution.
Describe the solution you'd like
global.extraLabels(orcommonLabels) merged intometadata.labelsof every resource the chart renders, including pod templates. This is a well-established pattern in other popular charts (kube-prometheus-stackcommonLabels, ingress-nginxcommonLabels, Bitnami'scommonLabels, cert-managerglobal.commonLabels).app.kubernetes.io/version: {{ .Chart.AppVersion }}as part of the standard labels on all resources.To keep upgrades safe, the common labels should be added to
metadata.labelsand pod template labels only, not tospec.selector/matchLabels, which are immutable on existing StatefulSets/Deployments.Existing per-resource
extraLabelsvalues would keep working as more specific overrides, so the change is fully backwards-compatible.Describe alternatives you've considered
helm install/upgradeworkflow.extraLabelsadditions: this is what the existing open PRs do (Add server.extraLabels to the StatefulSet metadata in addition to its Pods #505, Add labels to deployment, statefulset, service accounts and volumeClaimTemplates #680, feat: Support extraLabels in Service #1176), but piecemeal coverage has left gaps for years and several of those PRs have gone stale.Additional context
Related open issues:
server.extraLabelsapplies only to pods, not StatefulSet metadataRelated open PRs:
server.extraLabelsto StatefulSet metadata (open since ~2021)(revival of Add labels to deployment, statefulset and service accounts #478, now stale with conflicts)
extraLabelsfor Service resources onlyhelm.sh/chartlabels on some resourcesA chart-wide mechanism would resolve #911, #992, and supersede #505, #680, and #1176 in one consistent change rather than several partial ones.
I'm happy to contribute the PR for this (wip)