helm-charts/charts/maildev/templates/cron.yaml
devthejo 723ccf5a19
Some checks failed
Mirror Sync / codeberg (push) Successful in 9s
🎉 Release Commit / create release using commit-and-tag-version (push) Has been cancelled
fix: maildev cron
2024-08-17 19:41:58 +02:00

54 lines
2 KiB
YAML

{{- if and .Values.persistence.enabled .Values.cron.enabled }}
apiVersion: batch/v1
kind: CronJob
metadata:
name: {{ include "common.names.fullname" . }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
schedule: {{ .Values.cron.schedule | quote }}
startingDeadlineSeconds: 100
jobTemplate:
spec:
template:
spec:
containers:
- name: delete-mail
image: "{{ .Values.cron.image.repository }}:{{ .Values.cron.image.tag }}"
imagePullPolicy: {{ .Values.cron.image.pullPolicy }}
args:
- "find"
- "{{ .Values.persistence.mountPath }}"
- "-type"
- "f"
- "-mtime"
- "+{{ .Values.cron.daysToKeep }}"
- "-exec"
- "rm"
- "-f"
- "{}"
- ";"
volumeMounts:
- name: data
mountPath: {{ .Values.persistence.mountPath }}
securityContext:
runAsUser: 1000
runAsGroup: 1000
- name: reload-mail
image: "{{ .Values.cron.image.repository }}:{{ .Values.cron.image.tag }}"
imagePullPolicy: {{ .Values.cron.image.pullPolicy }}
args: ["wget","{{ include "common.names.fullname" . }}:1080/reloadMailsFromDirectory","-q","-O","/dev/null"]
securityContext:
runAsUser: 1000
runAsGroup: 1000
volumes:
- name: data
persistentVolumeClaim:
claimName: {{ include "common.names.fullname" . }}
restartPolicy: OnFailure
{{- end }}