diff --git a/charts/cron-job/templates/_helpers.tpl b/charts/cron-job/templates/_helpers.tpl index f6fe4166..5d3a2df3 100644 --- a/charts/cron-job/templates/_helpers.tpl +++ b/charts/cron-job/templates/_helpers.tpl @@ -41,6 +41,9 @@ helm.sh/chart: {{ include "helm-chart.chart" . }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- range $key, $value := .Values.commonLabels }} +{{ $key }}: {{ $value | quote }} +{{- end }} {{- end }} {{/* diff --git a/charts/cron-job/values.yaml b/charts/cron-job/values.yaml index 8c809926..0efaf9dc 100644 --- a/charts/cron-job/values.yaml +++ b/charts/cron-job/values.yaml @@ -8,6 +8,10 @@ command: | overrideCommand: true shell: "/bin/sh" +# commonLabels: +# label1: value1 +# label2: value2 + nameOverride: "" fullnameOverride: "" diff --git a/charts/namespaces/templates/_helpers.tpl b/charts/namespaces/templates/_helpers.tpl index 43f15203..3f941da3 100644 --- a/charts/namespaces/templates/_helpers.tpl +++ b/charts/namespaces/templates/_helpers.tpl @@ -41,6 +41,9 @@ helm.sh/chart: {{ include "helm-chart.chart" . }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- range $key, $value := .Values.commonLabels }} +{{ $key }}: {{ $value | quote }} +{{- end }} {{- end }} {{/* diff --git a/charts/onechart/templates/_helpers.tpl b/charts/onechart/templates/_helpers.tpl index f6fe4166..5d3a2df3 100644 --- a/charts/onechart/templates/_helpers.tpl +++ b/charts/onechart/templates/_helpers.tpl @@ -41,6 +41,9 @@ helm.sh/chart: {{ include "helm-chart.chart" . }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- range $key, $value := .Values.commonLabels }} +{{ $key }}: {{ $value | quote }} +{{- end }} {{- end }} {{/* diff --git a/charts/onechart/values.yaml b/charts/onechart/values.yaml index 7c26bfd3..1cc2ab45 100644 --- a/charts/onechart/values.yaml +++ b/charts/onechart/values.yaml @@ -16,6 +16,10 @@ image: # vars: # MY_VAR: "value" +# commonLabels: +# label1: value1 +# label2: value2 + replicas: 1 nameOverride: "" @@ -80,3 +84,4 @@ monitor: container: {} podSpec: {} + diff --git a/charts/static-site/templates/_helpers.tpl b/charts/static-site/templates/_helpers.tpl index 5b16735d..4072994d 100644 --- a/charts/static-site/templates/_helpers.tpl +++ b/charts/static-site/templates/_helpers.tpl @@ -34,6 +34,9 @@ Create chart name and version as used by the chart label. Common labels */}} {{- define "staticSite.labels" -}} +{{- range $key, $value := .Values.commonLabels }} +{{ $key }}: {{ $value | quote }} +{{- end }} helm.sh/chart: {{ include "staticSite.chart" . }} {{ include "staticSite.selectorLabels" . }} {{- if .Chart.AppVersion }} diff --git a/values-cron-job.yaml b/values-cron-job.yaml index faf33bb0..1e7998c0 100644 --- a/values-cron-job.yaml +++ b/values-cron-job.yaml @@ -15,3 +15,7 @@ volumes: path: /data size: 10Gi storageClass: default + +commonLabels: + label1: value1 + label2: value2 diff --git a/values.yaml b/values.yaml index cf54bd06..694014d8 100644 --- a/values.yaml +++ b/values.yaml @@ -26,3 +26,7 @@ probe: podSpec: hostNetwork: true + +commonLabels: + label1: value1 + label2: value2