diff --git a/charts/postgres-cluster/Chart.yaml b/charts/postgres-cluster/Chart.yaml index ee97f0d..9841544 100644 --- a/charts/postgres-cluster/Chart.yaml +++ b/charts/postgres-cluster/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: postgres-cluster -version: 2.2.0 +version: 2.2.1 description: Chart for cloudnative-pg cluster keywords: - database diff --git a/charts/postgres-cluster/templates/_backup.tpl b/charts/postgres-cluster/templates/_backup.tpl index 413ed57..e1e33da 100644 --- a/charts/postgres-cluster/templates/_backup.tpl +++ b/charts/postgres-cluster/templates/_backup.tpl @@ -3,7 +3,7 @@ backup: retentionPolicy: {{ .Values.backup.retentionPolicy }} barmanObjectStore: - destinationPath: "s3://{{ .Values.backup.endpointBucket }}/{{ .Values.kubernetesClusterName }}/postgresql/{{ include "cluster.name" . }}" + destinationPath: "s3://{{ .Values.backup.endpointBucket }}/{{ .Values.kubernetesClusterName }}/postgresql/{{ include "cluster.backupName" . }}" endpointURL: {{ .Values.backup.endpointURL }} {{- if .Values.backup.endpointCA }} endpointCA: diff --git a/charts/postgres-cluster/templates/_bootstrap.tpl b/charts/postgres-cluster/templates/_bootstrap.tpl index f352310..89fa0a3 100644 --- a/charts/postgres-cluster/templates/_bootstrap.tpl +++ b/charts/postgres-cluster/templates/_bootstrap.tpl @@ -63,7 +63,7 @@ externalClusters: - name: "{{ include "cluster.name" . }}-backup-{{ .Values.recovery.recoveryIndex }}" barmanObjectStore: serverName: "{{ include "cluster.name" . }}-backup-{{ .Values.recovery.recoveryIndex }}" - destinationPath: "s3://{{ .Values.recovery.endpointBucket }}/{{ .Values.kubernetesClusterName }}/postgresql/{{ .Values.recovery.recoveryName }}" + destinationPath: "s3://{{ .Values.recovery.endpointBucket }}/{{ .Values.kubernetesClusterName }}/postgresql/{{ include "cluster.recoveryName" . }}" endpointURL: {{ .Values.recovery.endpointURL }} {{- with .Values.recovery.endpointCA }} endpointCA: diff --git a/charts/postgres-cluster/templates/_helpers.tpl b/charts/postgres-cluster/templates/_helpers.tpl index cfd8f29..f3c3f25 100644 --- a/charts/postgres-cluster/templates/_helpers.tpl +++ b/charts/postgres-cluster/templates/_helpers.tpl @@ -56,6 +56,18 @@ Generate name for object store credentials {{- end }} {{- end }} +{{/* +Generate backup server name +*/}} +{{- define "cluster.backupName" -}} + {{- if .Values.backup.backupName -}} + {{- .Values.backup.backupName -}} + {{- else -}} + {{ include "cluster.name" . }} + {{- end }} +{{- end }} + + {{/* Generate recovery server name */}} diff --git a/charts/postgres-cluster/values.yaml b/charts/postgres-cluster/values.yaml index c727e80..8bb7f99 100644 --- a/charts/postgres-cluster/values.yaml +++ b/charts/postgres-cluster/values.yaml @@ -171,6 +171,9 @@ backup: # Generate external cluster name, creates: postgresql-{{ .Release.Name }}-cluster-backup-index-{{ .Values.backups.backupIndex }}" backupIndex: 1 + # Name of the backup cluster in the object store, defaults to "cluster.name" + backupName: "" + wal: # WAL compression method. One of `` (for no compression), `gzip`, `bzip2` or `snappy`. compression: snappy