Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions charts/cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ Kubernetes: `>=1.29.0-0`
| backups.scheduledBackups[0].name | string | `"daily-backup"` | Scheduled backup name |
| backups.scheduledBackups[0].pluginConfiguration | object | `{}` | |
| backups.scheduledBackups[0].schedule | string | `"0 0 0 * * *"` | Schedule in cron format |
| backups.scheduledBackups[0].target | string | `""` | The policy to decide which instance should perform this backup, one of `primary` or `prefer-standby`. If empty, it defaults to `cluster.spec.backup.target`. |
| backups.secret.create | bool | `true` | Whether to create a secret for the backup credentials |
| backups.secret.name | string | `""` | Name of the backup credentials secret |
| backups.wal.compression | string | `"gzip"` | WAL compression method. One of `` (for no compression), `gzip`, `bzip2` or `snappy`. |
Expand Down
3 changes: 3 additions & 0 deletions charts/cluster/templates/scheduled-backups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ spec:
schedule: {{ .schedule | quote }}
method: {{ .method }}
backupOwnerReference: {{ .backupOwnerReference }}
{{- with .target }}
target: {{ . }}
{{- end }}
cluster:
name: {{ include "cluster.fullname" $ }}
{{- with .pluginConfiguration }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ spec:
schedule: "0 0 0 * * *"
method: plugin
backupOwnerReference: self
target: prefer-standby
cluster:
name: scheduledbackups-cluster
---
Expand All @@ -46,6 +47,7 @@ spec:
schedule: "0 0 0 * * 1"
method: plugin
backupOwnerReference: self
target: primary
cluster:
name: scheduledbackups-cluster
pluginConfiguration:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ backups:
schedule: "0 0 0 * * *"
backupOwnerReference: self
method: plugin
target: prefer-standby
pluginConfiguration:
name: barman-cloud.cloudnative-pg.io
- name: weekly-backup
schedule: "0 0 0 * * 1"
backupOwnerReference: self
method: plugin
target: primary
pluginConfiguration:
name: barman-cloud.cloudnative-pg.io
5 changes: 5 additions & 0 deletions charts/cluster/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,11 @@
"default": "0 0 0 * * *",
"description": "Schedule in cron format",
"type": "string"
},
"target": {
"default": "",
"description": "The policy to decide which instance should perform this backup, one of `primary` or `prefer-standby`. If empty, it defaults to `cluster.spec.backup.target`.",
"type": "string"
}
},
"required": [],
Expand Down
2 changes: 2 additions & 0 deletions charts/cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,8 @@ backups:
schedule: "0 0 0 * * *"
# -- Backup owner reference
backupOwnerReference: self
# -- The policy to decide which instance should perform this backup, one of `primary` or `prefer-standby`. If empty, it defaults to `cluster.spec.backup.target`.
target: ""
# -- Backup method, can be `barmanObjectStore` (default), `volumeSnapshot` or `plugin`.
method: barmanObjectStore
pluginConfiguration: {}
Expand Down