From 5d04a1ff92e0ad666e99e676ef2123bb8de0dd27 Mon Sep 17 00:00:00 2001 From: Justin Zandbergen Date: Thu, 25 Nov 2021 14:26:55 +0100 Subject: [PATCH] Add feature to bring your own secret resource --- helm/mail/templates/statefulset.yaml | 4 ++++ helm/mail/values.yaml | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/helm/mail/templates/statefulset.yaml b/helm/mail/templates/statefulset.yaml index 14ed96d..a341d88 100644 --- a/helm/mail/templates/statefulset.yaml +++ b/helm/mail/templates/statefulset.yaml @@ -88,6 +88,10 @@ spec: - secretRef: name: {{ $fullName | quote }} {{- end }} + {{- if .Values.existingSecret }} + - secretRef: + name: {{ .Values.existingSecret | quote }} + {{- end }} {{ with .Values.extraEnv }}env: {{- toYaml . | nindent 12 }}{{ end }} volumeMounts: - mountPath: /var/spool/postfix diff --git a/helm/mail/values.yaml b/helm/mail/values.yaml index 663d921..448453f 100644 --- a/helm/mail/values.yaml +++ b/helm/mail/values.yaml @@ -90,6 +90,10 @@ certs: # hello: world secret: {} +# Use an existing secret to share with the pod +# as environment variables. +existingSecret: "" + # Define a secret which should be deployed together with the # chart amd mounted into a specific directory in the pod. mountSecret: @@ -172,4 +176,4 @@ startupProbe: ps axf | fgrep -v grep | fgrep -q 'opendkim.sh' lifecycle: - postStart: {} \ No newline at end of file + postStart: {}