Skip to content

Commit 0d0ca23

Browse files
Modify backup-on-pvc.yaml for job settings
Updated backup job configuration to handle extra configurations and changed the restart policy to OnFailure.
1 parent f70a1e9 commit 0d0ca23

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

charts/devtron-backups/templates/backup-on-pvc.yaml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ spec:
1414
schedule: {{ .Values.global.schedule }}
1515
jobTemplate:
1616
spec:
17-
{{- if $.Values.global.extraConfig }}
18-
{{ toYaml $.Values.global.extraConfig | indent 6 }}
19-
{{- end }}
2017
template:
2118
{{- if or $.Values.postgres_backup.labels $.Values.postgres_backup.annotations }}
2219
metadata:
@@ -49,7 +46,7 @@ spec:
4946
{{- if $.Values.global.PERSISTENCE.encryption.enabled }}
5047
- set -ex; mkdir -p /postgres/ ; date1=$(date +%Y%m%d-%H%M); pg_dumpall -h postgresql-postgresql.devtroncd -p 5432 -U postgres --no-privileges > /postgres/backup-$date1.tar ; gpg -c --batch --passphrase {{ .Values.global.PERSISTENCE.encryption.passphrase }} /postgres/backup-$date1.tar ; rm -rvf /postgres/backup-$date1.tar;
5148
{{- else }}
52-
- set -ex; mkdir -p /postgres/ ; date1=$(date +%Y%m%d-%H%M); pg_dumpall -h {{ .Values.postgres_backup.host | default "postgresql-postgresql.devtroncd" }} --exclude-database=clairv4 -p 5432 -U postgres --no-privileges > /postgres/backup-$date1.tar ;
49+
- set -ex; mkdir -p /postgres/ ; date1=$(date +%Y%m%d-%H%M); pg_dumpall -h {{ .Values.postgres_backup.host | default "postgresql-postgresql.devtroncd" }} --exclude-database=clairv4 -p 5432 -U postgres --no-privileges > /postgres/backup-$date1.tar ; rm -rvf /postgres/backup-$date1.tar;
5350
{{- end }}
5451
resources:
5552
{{ toYaml .Values.postgres_backup.resources | indent 12 }}
@@ -69,7 +66,7 @@ spec:
6966
tolerations:
7067
{{ toYaml .Values.global.tolerations | indent 12 }}
7168
{{- end }}
72-
restartPolicy: Never
69+
restartPolicy: OnFailure
7370
{{- end }}
7471
{{- if and (.Values.global.PERSISTENCE.enabled) (not .Values.global.PERSISTENCE.existingClaim) }}
7572
---
@@ -104,10 +101,6 @@ spec:
104101
schedule: {{ .Values.global.schedule }}
105102
jobTemplate:
106103
spec:
107-
backoffLimit: 0
108-
{{- if $.Values.global.extraConfig }}
109-
{{ toYaml $.Values.global.extraConfig | indent 6 }}
110-
{{- end }}
111104
template:
112105
{{- if or $.Values.postgres_backup.labels $.Values.postgres_backup.annotations }}
113106
metadata:
@@ -155,7 +148,7 @@ spec:
155148
tolerations:
156149
{{ toYaml .Values.global.tolerations | indent 12 }}
157150
{{- end }}
158-
restartPolicy: Never
151+
restartPolicy: OnFailure
159152
serviceAccountName: argocd-backup
160153
{{- end }}
161154
{{- end }}

0 commit comments

Comments
 (0)