3 changed files with 51 additions and 0 deletions
@ -0,0 +1,31 @@ |
|||
{{- if and .Values.postgresql.enabled .Values.postgresql.backup.enabled }} |
|||
apiVersion: postgresql.cnpg.io/v1 |
|||
kind: ScheduledBackup |
|||
metadata: |
|||
name: {{ .Values.postgresql.clusterName }}-scheduled-backup |
|||
namespace: {{ .Release.Namespace }} |
|||
labels: |
|||
{{- include "caduser.labels" . | nindent 4 }} |
|||
spec: |
|||
# Run an immediate backup when the ScheduledBackup is created |
|||
immediate: {{ .Values.postgresql.backup.schedule.immediate }} |
|||
|
|||
# Schedule backups using cron expression |
|||
schedule: {{ .Values.postgresql.backup.schedule.cron | quote }} |
|||
|
|||
# Use Barman Cloud plugin for backups |
|||
method: plugin |
|||
|
|||
# Configure the Barman Cloud plugin |
|||
pluginConfiguration: |
|||
name: barman-cloud.cloudnative-pg.io |
|||
parameters: |
|||
barmanObjectName: {{ .Values.postgresql.clusterName }} |
|||
|
|||
# Reference to the PostgreSQL cluster |
|||
cluster: |
|||
name: {{ .Values.postgresql.clusterName }} |
|||
|
|||
# Set the cluster as the owner of the backup resources |
|||
backupOwnerReference: cluster |
|||
{{- end }} |
|||
Loading…
Reference in new issue