Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Bouquillon committed Aug 1, 2023
1 parent 3019bbc commit e545d7c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/cnpg-cluster/templates/backup-cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
app: cnpg-backup-s3-client
name: backup-cron
spec:
schedule: "0 0 * * *"
schedule: {{ or .Values.backup.sqlDumpSchedule .Values.backup.schedule "0 0 * * *" }}
concurrencyPolicy: Forbid
jobTemplate:
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ cluster with enabled backup and recovery:
securityContext:
allowPrivilegeEscalation: false
restartPolicy: Never
schedule: 0 0 * * *
schedule: 4 5 6 * * 0
2: |
backup:
barmanObjectStore:
Expand Down
4 changes: 4 additions & 0 deletions charts/cnpg-cluster/tests/cnpg-cluster_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ tests:
equal:
path: spec.schedule
value: "1 2 3 * * 0"
- template: backup-cron.yaml
equal:
path: spec.schedule
value: "4 5 6 * * 0"
- template: backup-cron.yaml
hasDocuments:
count: 1
Expand Down
1 change: 1 addition & 0 deletions charts/cnpg-cluster/tests/values/backup.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
backup:
enabled: true
schedule: "1 2 3 * * 0"
sqlDumpSchedule: "4 5 6 * * 0"
barmanObjectStore:
destinationPath: s3://backups/
endpointURL: http://minio:9000
Expand Down
3 changes: 3 additions & 0 deletions charts/cnpg-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ backup:
# this cron format has the seconds on the left
schedule: "0 0 0 * * 0"

# -- Schedule the SQL dump backups, for instance every Sunday
sqlDumpSchedule: "0 0 0 * * 0"

# -- RetentionPolicy is the retention policy to be used for backups and WALs (i.e. '60d').
# The retention policy is expressed in the form of XXu where XX is a positive integer and
# u is in [dwm] - days, weeks, months.
Expand Down

0 comments on commit e545d7c

Please sign in to comment.