|
| 1 | +{{- if .Values.cron.enabled }} |
| 2 | +apiVersion: batch/v1 |
| 3 | +kind: CronJob |
| 4 | +metadata: |
| 5 | + name: {{ include "synapse-compress-state.fullname" . }} |
| 6 | + labels: |
| 7 | + app.kubernetes.io/name: synapse-compress-state |
| 8 | + app.kubernetes.io/instance: {{ .Release.Name }} |
| 9 | + annotations: |
| 10 | + argocd.argoproj.io/sync-wave: "5" |
| 11 | +spec: |
| 12 | + successfulJobsHistoryLimit: 1 |
| 13 | + failedJobsHistoryLimit: 3 |
| 14 | + concurrencyPolicy: Forbid |
| 15 | + schedule: {{ .Values.cron.schedule | quote }} |
| 16 | + jobTemplate: |
| 17 | + spec: |
| 18 | + activeDeadlineSeconds: {{ .Values.cron.activeDeadlineSeconds }} |
| 19 | + backoffLimit: 1 |
| 20 | + parallelism: 1 |
| 21 | + template: |
| 22 | + metadata: |
| 23 | + labels: |
| 24 | + app.kubernetes.io/name: synapse-compress-state |
| 25 | + app.kubernetes.io/instance: {{ .Release.Name }} |
| 26 | + annotations: |
| 27 | + argocd.argoproj.io/sync-wave: "5" |
| 28 | + spec: |
| 29 | + activeDeadlineSeconds: {{ .Values.activeDeadlineSeconds }} |
| 30 | + restartPolicy: Never |
| 31 | + containers: |
| 32 | + - name: compress |
| 33 | + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.appVersion }}" |
| 34 | + imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 35 | + args: |
| 36 | + - "--postgres-url=$(DATABASE_URL)" |
| 37 | + - "--chunk-size={{ .Values.cmdArgs.chunkSize }}" |
| 38 | + - "--min-state-groups={{ .Values.cmdArgs.minStateGroups }}" |
| 39 | + {{- if .Values.cmdArgs.progress }} |
| 40 | + - "--progress" |
| 41 | + {{- end }} |
| 42 | + # |
| 43 | + env: |
| 44 | + - name: DATABASE_URL |
| 45 | + valueFrom: |
| 46 | + secretKeyRef: |
| 47 | + {{- if .Values.existingSecret.name }} |
| 48 | + name: {{ .Values.existingSecret.name }} |
| 49 | + key: {{ .Values.existingSecret.databaseUrlKey }} |
| 50 | + {{- else }} |
| 51 | + name: {{ include "synapse-compress-state.fullname" . }} |
| 52 | + key: DATABASE_URL |
| 53 | + {{- end }} |
| 54 | + resources: |
| 55 | + {{ toYaml .Values.resources | nindent 16 }} |
| 56 | + {{- if .Values.nodeSelector }} |
| 57 | + nodeSelector: |
| 58 | + {{ toYaml .Values.nodeSelector | nindent 12 }} |
| 59 | + {{- end }} |
| 60 | + {{- if .Values.tolerations }} |
| 61 | + tolerations: |
| 62 | + {{ toYaml .Values.tolerations | nindent 12 }} |
| 63 | + {{- end }} |
| 64 | + {{- if .Values.affinity }} |
| 65 | + affinity: |
| 66 | + {{ toYaml .Values.affinity | nindent 12 }} |
| 67 | + {{- end }} |
| 68 | +{{- end }} |
0 commit comments