diff --git a/charts/pmm/Chart.yaml b/charts/pmm/Chart.yaml index 333e687a..a82b7a7b 100644 --- a/charts/pmm/Chart.yaml +++ b/charts/pmm/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: pmm description: A Helm chart for Percona Monitoring and Management (PMM) type: application -version: 1.3.13 +version: 1.4.0 appVersion: "2.41.2" home: https://github.com/percona/pmm maintainers: diff --git a/charts/pmm/templates/extraObjects.yaml b/charts/pmm/templates/extraObjects.yaml new file mode 100644 index 00000000..cf4551ab --- /dev/null +++ b/charts/pmm/templates/extraObjects.yaml @@ -0,0 +1,24 @@ +{{- /* Define extraObjects to handle both list and map scenarios */ -}} +{{- $extraObjects := .Values.extraObjects }} + +{{- if not (kindIs "slice" .Values.extraObjects) }} + {{- if kindIs "map" .Values.extraObjects }} + {{- $extraObjects = list }} + {{- range $key, $value := .Values.extraObjects }} + {{- $extraObjects = append $extraObjects $value }} + {{- end }} + {{- else }} + {{- fail ".Values.extraObjects must be a list or dictionary object" }} + {{- end }} +{{- end }} + +{{- range $extraObjects }} +--- +{{- if kindIs "map" . }} +{{ tpl (toYaml .) $ }} +{{- else if kindIs "string" . }} +{{ tpl . $ }} +{{- else }} +{{- fail "grandchilden of .Values.extraObjects must be a dictionary or string" }} +{{- end }} +{{- end }} diff --git a/charts/pmm/values.yaml b/charts/pmm/values.yaml index 7e27b82a..3722f70b 100644 --- a/charts/pmm/values.yaml +++ b/charts/pmm/values.yaml @@ -265,3 +265,30 @@ extraVolumeMounts: [] ## @param extraVolumes Optionally specify extra list of additional volumes ## extraVolumes: [] + +## @param extraObjects Optional set of manifests to deploy +## Can be defined as either a list of dictionary +## List objects can template keys, but doesn't support merging from multiple values files. +## Dictionaries can't template keys, but can merge values files which makes it better suited for use with encrypted and unencrypted values files. +extraObjects: [] +# meaningless_key: +# apiVersion: v1 +# kind: Secret +# type: Opaque +# metadata: +# name: configmap +# data: +# token: | +# {{ print "public configmap" | b64enc }} +# - | +# {{- range (list "1" "2" "3") }} +# --- +# apiVersion: v1 +# kind: Secret +# type: Opaque +# metadata: +# name: google-serviceaccount +# data: +# {{ printf "secret-%s" . }}: | +# {{ print "super secret password" | b64enc }} +# {{- end }}