fix(cnpg): Migrate to barman cloud plugin

This commit is contained in:
2025-11-23 16:19:46 +01:00
parent 79365abd71
commit 99d10c2316
3 changed files with 44 additions and 47 deletions
+44 -16
View File
@@ -18,22 +18,12 @@ spec:
# the switchover of the primary
primaryUpdateStrategy: unsupervised
{{- if .Values.cluster.backup.enabled }}
backup:
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}}
plugins:
- name: barman-cloud.cloudnative-pg.io
isWALArchiver: true
parameters:
barmanObjectName: tos-store
{{- end}}
storage:
size: {{ .Values.cluster.size | default "5Gi" }}
{{- with .Values.cluster.bootstrap }}
@@ -67,6 +57,44 @@ spec:
{{- end }}
{{- end }}
---
{{- if .Values.cluster.backup.enabled -}}
apiVersion: barmancloud.cnpg.io/v1
kind: ObjectStore
metadata:
name: tos-store
namespace: {{ .Release.Namespace }}
spec:
retentionPolicy: {{ .Values.cluster.backup.backupRetention | default "60d" }}
configuration:
destinationPath: {{ .Values.cluster.destinationPath | default ""}}
serverName: {{ include "Atlantis.fullname" . }}-db
endpointURL: http://10.255.241.30:30080
s3Credentials:
accessKeyId:
name: cnpg-s3
key: access_key
secretAccessKey:
name: cnpg-s3
key: access_secret
wal:
compression: snappy
{{- end}}
---
{{- 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'
method: plugin
pluginConfiguration:
name: barman-cloud.cloudnative-pg.io
{{- end }}
---
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
-11
View File
@@ -1,11 +0,0 @@
{{- 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 }}
@@ -1,20 +0,0 @@
{{- if eq .Values.clusterConfig.cluster "oceanbox"}}
apiVersion: barmancloud.cnpg.io/v1
kind: ObjectStore
metadata:
name: tos-store
spec:
retentionPolicy: "30d"
configuration:
destinationPath: s3://cnpg
endpointURL: http://10.255.241.30:30080
s3Credentials:
accessKeyId:
name: cnpg-s3
key: access_key
secretAccessKey:
name: cnpg-s3
key: access_secret
wal:
compression: snappy
{{- end}}