diff --git a/charts/postfix/v0.1.0/templates/_helpers.tpl b/charts/postfix/v0.1.0/templates/_helpers.tpl index 9914e08..e43db0d 100644 --- a/charts/postfix/v0.1.0/templates/_helpers.tpl +++ b/charts/postfix/v0.1.0/templates/_helpers.tpl @@ -60,3 +60,13 @@ Create the name of the service account to use {{- default "default" .Values.serviceAccount.name }} {{- end }} {{- end }} + +{{/* +Return true if a configmap object should be created for Postfix +*/}} +{{- define "postfix.createConfigmap" -}} +{{- if .Values.postfix.configuration }} + {{- true -}} +{{- else -}} +{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/charts/postfix/v0.1.0/templates/app.yaml b/charts/postfix/v0.1.0/templates/app.yaml index 02727e3..2cace16 100644 --- a/charts/postfix/v0.1.0/templates/app.yaml +++ b/charts/postfix/v0.1.0/templates/app.yaml @@ -64,6 +64,12 @@ spec: port: 25 initialDelaySeconds: 10 periodSeconds: 15 + volumeMounts: + {{- if .Values.postfix.configuration }} + - name: config + mountPath: /overrides/postfix.cf + subPath: postfix.cf + {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} {{- with .Values.nodeSelector }} @@ -90,3 +96,9 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} + volumes: + {{- if .Values.postfix.configuration }} + - name: config + configMap: + name: {{ include "postfix.fullname" . }} + {{- end }} diff --git a/charts/postfix/v0.1.0/templates/configmap.yaml b/charts/postfix/v0.1.0/templates/configmap.yaml new file mode 100644 index 0000000..bae369d --- /dev/null +++ b/charts/postfix/v0.1.0/templates/configmap.yaml @@ -0,0 +1,11 @@ +{{- if (include "postfix.createConfigmap" .) }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "postfix.fullname" . }} + namespace: {{ .Release.Namespace | quote }} + labels: {{- include "postfix.labels" . | nindent 4 }} +data: + postfix.cf: |- +{{ .Values.postfix.configuration | indent 4 }} +{{- end -}} \ No newline at end of file diff --git a/charts/postfix/v0.1.0/values.yaml b/charts/postfix/v0.1.0/values.yaml index 7e563c7..6c031e2 100644 --- a/charts/postfix/v0.1.0/values.yaml +++ b/charts/postfix/v0.1.0/values.yaml @@ -46,6 +46,7 @@ postfix: relayNets: 10.42.0.0/16 senderBcc: "" kind: StatefulSet + configuration: "" autoscaling: enabled: false