Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pmm] add extraObjects #330

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/pmm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
24 changes: 24 additions & 0 deletions charts/pmm/templates/extraObjects.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
27 changes: 27 additions & 0 deletions charts/pmm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}