From 85d5f89e610d3f91b2bc72565ff50aed7e020b34 Mon Sep 17 00:00:00 2001 From: Andrew Lavery Date: Wed, 1 May 2024 19:06:47 +0800 Subject: [PATCH] add the ability to specify additional labels --- templates/_helpers.tpl | 4 ++++ values.yaml.tmpl | 3 +++ 2 files changed, 7 insertions(+) diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl index 8f56ebb..afa190e 100644 --- a/templates/_helpers.tpl +++ b/templates/_helpers.tpl @@ -42,6 +42,10 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} kots.io/backup: velero kots.io/kotsadm: "true" app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- if (gt (len .Values.labels) 0) -}} +{{ printf "\n"}} +{{ .Values.labels | toYaml }} +{{- end -}} {{- end }} {{/* diff --git a/values.yaml.tmpl b/values.yaml.tmpl index a56371f..24ad14a 100644 --- a/values.yaml.tmpl +++ b/values.yaml.tmpl @@ -18,6 +18,9 @@ imagePullSecrets: [] nameOverride: "" fullnameOverride: "" +# Additional labels to add to all chart resources +labels: {} + serviceAccount: # Specifies whether a service account should be created create: true