Update: Add the possibility to add a Secret to the chart

This commit is contained in:
Bojan Čekrlić 2021-05-18 22:58:53 +02:00
parent c6e9a2e4a9
commit 4677036a14
4 changed files with 34 additions and 0 deletions

View file

@ -0,0 +1,15 @@
{{- $chart := "mail" -}}
{{- $fullName := include (print $chart ".fullname") . -}}
{{- $labels := include (print $chart ".labels") . -}}
{{- with .Values.secret }}
apiVersion: v1
kind: Secret
metadata:
name: {{ $fullName }}
labels:
{{- $labels | nindent 4 }}
data:
{{- range $key, $value := . }}
{{ $key }}: {{ $value | b64enc | quote }}
{{- end }}
{{ end }}

View file

@ -91,6 +91,10 @@ spec:
envFrom:
- configMapRef:
name: {{ $fullName | quote }}
{{- with .Values.secret }}
- secretRef:
name: {{ $fullName | quote }}
{{- end }}
{{ with .Values.extraEnv }}env: {{- toYaml . | nindent 12 }}{{ end }}
volumeMounts:
- mountPath: /var/spool/postfix

View file

@ -68,6 +68,10 @@ container:
postfix:
securityContext: {}
# Define data which should be stored in a Secret
# (and shared with the pod as environment variables)
# secret: {}
config:
general: {}
# e.g.

11
helm/test_5_secret.yml Normal file
View file

@ -0,0 +1,11 @@
autoscaling:
enabled: true
maxReplicas: 4
config:
general:
TZ: Europe/London
ALLOWED_SENDER_DOMAINS: example.org
secret:
Hello: "World"