fix(cnpg): Add scheduled backup to atlantis chart #19
@@ -17,8 +17,23 @@ spec:
|
||||
# - supervised: requires manual supervision to perform
|
||||
# the switchover of the primary
|
||||
primaryUpdateStrategy: unsupervised
|
||||
{{- if .Values.cluster.backup.enabled }}
|
||||
backup:
|
||||
retentionPolicy: {{ .Values.cluster.backupRetention | default "60d" }}
|
||||
barmanObjectStore:
|
||||
destinationPath: {{ .Values.cluster.destinationPath | default ""}}
|
||||
serverName: {{ include "Atlantis.fullname" . }}-db
|
||||
endpointURL: http://10.255.241.30:30080
|
||||
s3Credentials:
|
||||
accessKeyId:
|
||||
key: access_key
|
||||
name: cnpg-s3
|
||||
secretAccessKey:
|
||||
key: access_secret
|
||||
name: cnpg-s3
|
||||
wal:
|
||||
compression: snappy
|
||||
retentionPolicy: {{ .Values.cluster.backup.backupRetention | default "60d" }}
|
||||
{{- end}}
|
||||
storage:
|
||||
size: {{ .Values.cluster.size | default "5Gi" }}
|
||||
{{- with .Values.cluster.bootstrap }}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
{{- if and .Values.cluster.backup.enabled .Values.cluster.enabled -}}
|
||||
apiVersion: postgresql.cnpg.io/v1
|
||||
kind: ScheduledBackup
|
||||
metadata:
|
||||
name: {{ include "Atlantis.fullname" . }}-db
|
||||
spec:
|
||||
schedule: "0 0 1 * * *"
|
||||
backupOwnerReference: self
|
||||
cluster:
|
||||
name: '{{ include "Atlantis.fullname" . }}-db'
|
||||
{{- end }}
|
||||
@@ -76,8 +76,10 @@ persistence:
|
||||
cluster:
|
||||
enabled: true
|
||||
instances: 1
|
||||
backupEnabled: true
|
||||
backupRetention: 60d
|
||||
destinationPath: "s3://cnpg/prod-atlantis-db"
|
||||
backup:
|
||||
enabled: false
|
||||
backupRetention: 60d
|
||||
size: 5Gi
|
||||
bootstrap:
|
||||
enabled: true
|
||||
|
||||
Reference in New Issue
Block a user