Skip to content

Commit ff050ff

Browse files
committed
Add recovery object store reference
This allows an external object store to be referenced which is used for restore procedures.
1 parent 0b13a43 commit ff050ff

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

charts/vshnpostgresql/templates/_external_clusters.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ externalClusters:
2020
plugin:
2121
name: barman-cloud.cloudnative-pg.io
2222
parameters:
23-
barmanObjectName: {{ include "cluster.fullname" $ }}-object-store
23+
barmanObjectName: {{ .Values.recovery.objectStoreName | default (printf "%s-object-store" (include "cluster.fullname" .)) }}
2424
serverName: {{ .Values.recovery.clusterName | default (include "cluster.fullname" .) }}
2525
{{- end }}
2626
{{- else if eq .Values.mode "replica" }}

charts/vshnpostgresql/templates/objectStore.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ spec:
99
retentionPolicy: {{ . }}
1010
{{- end }}
1111
configuration:
12-
{{- if and (eq .Values.mode "recovery") (eq .Values.recovery.method "object_store") -}}
12+
{{- if and (eq .Values.mode "recovery") (eq .Values.recovery.method "object_store") (empty .Values.recovery.objectStoreName) -}}
1313
{{- $d := dict "chartFullname" (include "cluster.fullname" .) "scope" .Values.recovery "secretPrefix" "recovery" -}}
1414
{{- include "cluster.barmanObjectStoreConfig" $d | indent 2 }}
1515
{{- else }}

charts/vshnpostgresql/templates/recovery-s3-creds.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if and (eq .Values.mode "recovery" ) (eq .Values.recovery.method "object_store") (eq .Values.recovery.provider "s3") (not .Values.recovery.s3.inheritFromIAMRole) .Values.recovery.secret.create }}
1+
{{- if and (eq .Values.mode "recovery" ) (eq .Values.recovery.method "object_store") (empty .Values.recovery.objectStoreName) (eq .Values.recovery.provider "s3") (not .Values.recovery.s3.inheritFromIAMRole) .Values.recovery.secret.create }}
22
apiVersion: v1
33
kind: Secret
44
metadata:

charts/vshnpostgresql/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ recovery:
4949
##
5050
# -- The original cluster name when used in backups. Also known as serverName.
5151
clusterName: ""
52+
# -- Name of an externally managed ObjectStore to use for recovery.
53+
# When set, the chart's own ObjectStore keeps backup credentials,
54+
# and the external cluster references this ObjectStore instead.
55+
objectStoreName: ""
5256
# -- Name of the database used by the application. Default: `app`.
5357
database: app
5458
# -- Name of the owner of the database in the instance to be used by applications. Defaults to the value of the `database` key.

0 commit comments

Comments
 (0)