-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Define cron jobs running mgmt commands in Helm chart (#440)
* feat: Define cron jobs running mgmt commands in Helm chart * chore: Use UTC for cron jobs * chore: Prevent cron jobs from overlapping * chore: Disable retries on failed jobs
- Loading branch information
Showing
2 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{{- range .Values.cronjob.crons }} | ||
--- | ||
apiVersion: batch/v1 | ||
kind: CronJob | ||
metadata: | ||
name: {{ .name | quote }} | ||
spec: | ||
schedule: {{ .schedule | quote }} | ||
timeZone: {{ .timeZone | quote }} | ||
concurrencyPolicy: Forbid | ||
jobTemplate: | ||
spec: | ||
backoffLimit: 0 # No retries | ||
template: | ||
spec: | ||
restartPolicy: Never | ||
volumes: | ||
- name: settings-local-volume | ||
configMap: | ||
name: django-configmap | ||
containers: | ||
- name: {{ .name | quote }} | ||
image: "{{ .image.repository }}:{{ default $.Chart.AppVersion .image.tag }}" | ||
imagePullPolicy: {{ .image.pullPolicy }} | ||
volumeMounts: | ||
- name: settings-local-volume | ||
mountPath: /app/ietf/settings/local.py | ||
subPath: local.py | ||
readOnly: true | ||
{{- if $.Values.env }} | ||
env: | ||
- name: "POD_IP" | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: status.podIP | ||
{{- range $key, $val := $.Values.env }} | ||
- name: {{ $key | quote }} | ||
value: {{ $val | quote }} | ||
{{- end }} | ||
{{- end }} | ||
command: {{ .command | toJson }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters