From 67075a1af2e23620e7b3143cc530f20abdfa2c27 Mon Sep 17 00:00:00 2001 From: Fabio Rauber Date: Wed, 9 Feb 2022 14:28:50 -0300 Subject: [PATCH] Added first time mail config job --- .../emailleg/v1.4.0/templates/config-job.yaml | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 charts/emailleg/v1.4.0/templates/config-job.yaml diff --git a/charts/emailleg/v1.4.0/templates/config-job.yaml b/charts/emailleg/v1.4.0/templates/config-job.yaml new file mode 100644 index 0000000..130e4e6 --- /dev/null +++ b/charts/emailleg/v1.4.0/templates/config-job.yaml @@ -0,0 +1,60 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ include "emailleg.fullname" . }}-config + labels: + {{- include "emailleg.labels" . | nindent 4 }} +spec: + template: + metadata: + annotations: + "helm.sh/hook": post-install,post-upgrade + "helm.sh/hook-weight": "-1" + "helm.sh/hook-delete-policy": "hook-succeeded" + labels: + {{- include "emailleg.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + restartPolicy: Never + containers: + - image: "{{ .Values.config.image.repository }}:{{ .Values.config.image.tag }}" + name: {{ .Release.Name }}-config + env: + - name: DOMAIN + value: {{ .Values.mail.domain }} + - name: MANAGER_PW + value: {{ .Values.mail.managerPW }} + volumeMounts: + - mountPath: /data + subPath: data + name: mailvol + - mountPath: /certs + subPath: certs + name: mailvol + volumes: + - name: mailvol + persistentVolumeClaim: + claimName: {{ include "emailleg.fullname" . }}-mailvol + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + affinity: + podAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - {{ include "emailleg.name" . }} + - key: app.kubernetes.io/instance + operator: In + values: + - {{ .Release.Name }} + topologyKey: kubernetes.io/hostname \ No newline at end of file