From ec214c41a99d5f8a529fccc3b769963234c56462 Mon Sep 17 00:00:00 2001 From: gpothier Date: Fri, 26 Apr 2024 03:18:18 -0400 Subject: [PATCH] Add support for the `method` parameter in `scheduledBackups` (#265) * Add support for the `method` parameter in `scheduledBackups` Fixes #264 Signed-off-by: Guillaume Pothier --- charts/cluster/README.md | 1 + charts/cluster/templates/scheduled-backups.yaml | 1 + charts/cluster/values.schema.json | 3 +++ charts/cluster/values.yaml | 2 ++ 4 files changed, 7 insertions(+) diff --git a/charts/cluster/README.md b/charts/cluster/README.md index 747f9de61..ff59e34ef 100644 --- a/charts/cluster/README.md +++ b/charts/cluster/README.md @@ -140,6 +140,7 @@ refer to the [CloudNativePG Documentation](https://cloudnative-pg.io/documentat | backups.s3.region | string | `""` | | | backups.s3.secretKey | string | `""` | | | backups.scheduledBackups[0].backupOwnerReference | string | `"self"` | Backup owner reference | +| backups.scheduledBackups[0].method | string | `"barmanObjectStore"` | Backup method, can be `barmanObjectStore` (default) or `volumeSnapshot` | | backups.scheduledBackups[0].name | string | `"daily-backup"` | Scheduled backup name | | backups.scheduledBackups[0].schedule | string | `"0 0 0 * * *"` | Schedule in cron format | | backups.wal.compression | string | `"gzip"` | WAL compression method. One of `` (for no compression), `gzip`, `bzip2` or `snappy`. | diff --git a/charts/cluster/templates/scheduled-backups.yaml b/charts/cluster/templates/scheduled-backups.yaml index 36fbc4471..23f8c4ca4 100644 --- a/charts/cluster/templates/scheduled-backups.yaml +++ b/charts/cluster/templates/scheduled-backups.yaml @@ -10,6 +10,7 @@ metadata: spec: immediate: true schedule: {{ .schedule }} + method: {{ .method }} backupOwnerReference: {{ .backupOwnerReference }} cluster: name: {{ include "cluster.fullname" $context }} diff --git a/charts/cluster/values.schema.json b/charts/cluster/values.schema.json index 7bab0a443..46c874b1d 100644 --- a/charts/cluster/values.schema.json +++ b/charts/cluster/values.schema.json @@ -125,6 +125,9 @@ "backupOwnerReference": { "type": "string" }, + "method": { + "type": "string" + }, "name": { "type": "string" }, diff --git a/charts/cluster/values.yaml b/charts/cluster/values.yaml index f2651018b..7dad93eea 100644 --- a/charts/cluster/values.yaml +++ b/charts/cluster/values.yaml @@ -266,6 +266,8 @@ backups: schedule: "0 0 0 * * *" # -- Backup owner reference backupOwnerReference: self + # -- Backup method, can be `barmanObjectStore` (default) or `volumeSnapshot` + method: barmanObjectStore # -- Retention policy for backups retentionPolicy: "30d"