Skip to content

Commit 9e29f01

Browse files
authored
fix: pass deployment.labels to deployment (#618)
Description of changes: This pull request enhances the Helm deployment template by allowing users to add custom labels to Kubernetes deployments through values in the Helm chart, similar to what has been done at the `spec.template.labels` level. This makes the deployment more flexible and customizable. **Helm template improvements:** * Added support for injecting user-defined deployment labels from `.Values.deployment.labels` into the `metadata` section of the `deployment.yaml.tpl` template. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 1d9076d commit 9e29f01

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

templates/helm/templates/deployment.yaml.tpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ metadata:
1010
app.kubernetes.io/version: {{ "{{ .Chart.AppVersion | quote }}" }}
1111
k8s-app: {{ IncludeTemplate "app.name" }}
1212
helm.sh/chart: {{ IncludeTemplate "chart.name-version" }}
13+
{{ "{{- range $key, $value := .Values.deployment.labels }}" }}
14+
{{ "{{ $key }}: {{ $value | quote }}" }}
15+
{{ "{{- end }}" }}
1316
spec:
1417
replicas: {{ "{{ .Values.deployment.replicas }}" }}
1518
selector:

0 commit comments

Comments
 (0)