From c2f31ef0fde804642a848d919dbdf3d11b3dcbc6 Mon Sep 17 00:00:00 2001 From: Joaquin Rodriguez Date: Tue, 8 Sep 2026 13:37:37 -0400 Subject: [PATCH] feat(helm): add commonLabels support to the kmcp chart Adds a values.commonLabels map merged into kmcp.labels, so every resource this chart creates (controller Deployment, ServiceAccount, ClusterRoles/Bindings, Service) can carry operator-required labels (e.g. an admission policy demanding specific labels on all namespaced/cluster resources) without a fork or post-renderer. Default (commonLabels: {}) renders byte-identical output - verified with `helm template` diff against main. Signed-off-by: Joaquin Rodriguez --- helm/kmcp/templates/_helpers.tpl | 3 +++ helm/kmcp/values.yaml | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/helm/kmcp/templates/_helpers.tpl b/helm/kmcp/templates/_helpers.tpl index e71ec96..cdb5bdf 100644 --- a/helm/kmcp/templates/_helpers.tpl +++ b/helm/kmcp/templates/_helpers.tpl @@ -31,6 +31,9 @@ helm.sh/chart: {{ include "kmcp.chart" . }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- with .Values.commonLabels }} +{{- toYaml . | nindent 0 }} +{{- end }} {{- end }} {{/* diff --git a/helm/kmcp/values.yaml b/helm/kmcp/values.yaml index efd8b7d..ec38219 100644 --- a/helm/kmcp/values.yaml +++ b/helm/kmcp/values.yaml @@ -9,6 +9,17 @@ fullnameOverride: "" # @default -- `.Release.Namespace` namespaceOverride: "" +# -- Additional labels to add to every resource this chart creates +# (controller Deployment, ServiceAccount, ClusterRoles/Bindings, Service). +# Useful for admission policies that require specific labels on all +# namespaced/cluster resources. +# @default -- {} (no extra labels) +commonLabels: {} +# Example: +# commonLabels: +# team: platform +# environment: production + # Image configuration image: repository: ghcr.io/kagent-dev/kmcp/controller