|
14 | 14 | schedule: {{ .Values.global.schedule }} |
15 | 15 | jobTemplate: |
16 | 16 | spec: |
17 | | - {{- if $.Values.global.extraConfig }} |
18 | | -{{ toYaml $.Values.global.extraConfig | indent 6 }} |
19 | | - {{- end }} |
20 | 17 | template: |
21 | 18 | {{- if or $.Values.postgres_backup.labels $.Values.postgres_backup.annotations }} |
22 | 19 | metadata: |
|
49 | 46 | {{- if $.Values.global.PERSISTENCE.encryption.enabled }} |
50 | 47 | - 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; |
51 | 48 | {{- 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; |
53 | 50 | {{- end }} |
54 | 51 | resources: |
55 | 52 | {{ toYaml .Values.postgres_backup.resources | indent 12 }} |
|
69 | 66 | tolerations: |
70 | 67 | {{ toYaml .Values.global.tolerations | indent 12 }} |
71 | 68 | {{- end }} |
72 | | - restartPolicy: Never |
| 69 | + restartPolicy: OnFailure |
73 | 70 | {{- end }} |
74 | 71 | {{- if and (.Values.global.PERSISTENCE.enabled) (not .Values.global.PERSISTENCE.existingClaim) }} |
75 | 72 | --- |
@@ -104,10 +101,6 @@ spec: |
104 | 101 | schedule: {{ .Values.global.schedule }} |
105 | 102 | jobTemplate: |
106 | 103 | spec: |
107 | | - backoffLimit: 0 |
108 | | - {{- if $.Values.global.extraConfig }} |
109 | | -{{ toYaml $.Values.global.extraConfig | indent 6 }} |
110 | | - {{- end }} |
111 | 104 | template: |
112 | 105 | {{- if or $.Values.postgres_backup.labels $.Values.postgres_backup.annotations }} |
113 | 106 | metadata: |
@@ -155,7 +148,7 @@ spec: |
155 | 148 | tolerations: |
156 | 149 | {{ toYaml .Values.global.tolerations | indent 12 }} |
157 | 150 | {{- end }} |
158 | | - restartPolicy: Never |
| 151 | + restartPolicy: OnFailure |
159 | 152 | serviceAccountName: argocd-backup |
160 | 153 | {{- end }} |
161 | 154 | {{- end }} |
0 commit comments