Browse Source

Implemente postfix overrides configmap

master
Fábio Kaiser Rauber 3 years ago
parent
commit
3ac54ec428
  1. 10
      charts/postfix/v0.1.0/templates/_helpers.tpl
  2. 12
      charts/postfix/v0.1.0/templates/app.yaml
  3. 11
      charts/postfix/v0.1.0/templates/configmap.yaml
  4. 1
      charts/postfix/v0.1.0/values.yaml

10
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 -}}

12
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 }}

11
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 -}}

1
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

Loading…
Cancel
Save