From c972af436ad115f0a1ccaf6a83398e72002e9fea Mon Sep 17 00:00:00 2001 From: Fabio Date: Tue, 16 Aug 2022 11:38:56 -0300 Subject: [PATCH] Add envfile secret to mail-mta-autoconfig --- .../v0.1.0/templates/cronjob.yaml | 15 ++++++++++++--- charts/mail-mta-autoconfig/v0.1.0/values.yaml | 16 +++++++++++++--- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/charts/mail-mta-autoconfig/v0.1.0/templates/cronjob.yaml b/charts/mail-mta-autoconfig/v0.1.0/templates/cronjob.yaml index 62647ec..643c43e 100644 --- a/charts/mail-mta-autoconfig/v0.1.0/templates/cronjob.yaml +++ b/charts/mail-mta-autoconfig/v0.1.0/templates/cronjob.yaml @@ -5,8 +5,7 @@ metadata: labels: {{- include "mail-mta-autoconfig.labels" . | nindent 4 }} spec: - # generate a random backup time between 1 and 5 AM - schedule: {{ .Values.schedule }} + schedule: "{{ .Values.schedule }}" concurrencyPolicy: Forbid jobTemplate: spec: @@ -27,7 +26,17 @@ spec: image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} command: [ "python3", "watch.py" ] - restartPolicy: OnFailure + {{ if .Values.secretName }} + volumeMounts: + - mountPath: "/root/.env" + name: envfile + subPath: .env + readOnly: true + volumes: + - name: envfile + secret: + secretName: {{ .Values.secretName }} + {{ end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 12 }} diff --git a/charts/mail-mta-autoconfig/v0.1.0/values.yaml b/charts/mail-mta-autoconfig/v0.1.0/values.yaml index 4767d34..4f2dc82 100644 --- a/charts/mail-mta-autoconfig/v0.1.0/values.yaml +++ b/charts/mail-mta-autoconfig/v0.1.0/values.yaml @@ -1,7 +1,7 @@ # Default values for mail-mta-autoconfig. image: - repository: porto.interlegis.leg.br/library/mail-mta-autoconfig + repository: porto.interlegis.leg.br/seit/mail-mta-autoconfig pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. tag: "" @@ -27,8 +27,18 @@ podAnnotations: {} podSecurityContext: {} # fsGroup: 2000 -# Defaults to midnight -schedule: "0 0 * * *" +# Existing secret name. +# The secret must define the following variables: +# PDNS_API_SERVER=https://pdns.api.url +# PDNS_API_KEY=anapikey +# REDIS_HOST=hostname +# REDIS_DB=3 +# REDIS_PASS=agoodredispassword +# DKIM_SELECTOR=dkimselector +secretName: "" + +# Defaults to every 5 minutes +schedule: "*/5 * * * *" securityContext: {} # capabilities: