From 3ecef5f8d14604c71b211821a9c1871bf8374506 Mon Sep 17 00:00:00 2001 From: alexlebens Date: Fri, 27 Sep 2024 21:27:01 -0500 Subject: [PATCH] add options for tagging --- charts/postgres-cluster/Chart.yaml | 4 ++-- charts/postgres-cluster/templates/_backup.tpl | 8 ++++++++ charts/postgres-cluster/values.yaml | 11 +++++++++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/charts/postgres-cluster/Chart.yaml b/charts/postgres-cluster/Chart.yaml index 62f068c..3272cf1 100644 --- a/charts/postgres-cluster/Chart.yaml +++ b/charts/postgres-cluster/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: postgres-cluster -version: 3.9.0 +version: 3.10.0 description: Chart for cloudnative-pg cluster keywords: - database @@ -10,4 +10,4 @@ sources: maintainers: - name: alexlebens icon: https://avatars.githubusercontent.com/u/100373852?s=48&v=4 -appVersion: v1.23.3 +appVersion: v1.24.0 diff --git a/charts/postgres-cluster/templates/_backup.tpl b/charts/postgres-cluster/templates/_backup.tpl index 934cf72..76bf33c 100644 --- a/charts/postgres-cluster/templates/_backup.tpl +++ b/charts/postgres-cluster/templates/_backup.tpl @@ -11,6 +11,14 @@ backup: key: ca-bundle.crt {{- end }} serverName: "{{ include "cluster.name" . }}-backup-{{ .Values.backup.backupIndex }}" + tags: + {{- with .Values.backup.tags }} + {{- . | toYaml | nindent 6 }} + {{- end }} + historyTags: + {{- with .Values.backup.historyTags }} + {{- . | toYaml | nindent 6 }} + {{- end }} s3Credentials: accessKeyId: name: {{ include "cluster.backupCredentials" . }} diff --git a/charts/postgres-cluster/values.yaml b/charts/postgres-cluster/values.yaml index 01e4906..b6ade83 100644 --- a/charts/postgres-cluster/values.yaml +++ b/charts/postgres-cluster/values.yaml @@ -174,6 +174,13 @@ backup: # Name of the backup cluster in the object store, defaults to "cluster.name" backupName: "" + # Tags to add to backups. Add in key value beneath the type. + tags: + backupRetentionPolicy: "expire" + historyTags: + backupRetentionPolicy: "keep" + + # Configuration for the WAL and data files. wal: # WAL compression method. One of `` (for no compression), `gzip`, `bzip2` or `snappy`. compression: snappy @@ -190,7 +197,7 @@ backup: jobs: 2 # Retention policy for backups - retentionPolicy: "30d" + retentionPolicy: "60d" # Scheduled backup in cron format - schedule: "0 0 0 * * *" + schedule: "0 0 */3 * *"