From 99d10c2316a0c5435bbd494bb379a55ed2e5166f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20J=C3=B6rg?= Date: Sun, 23 Nov 2025 16:19:46 +0100 Subject: [PATCH] fix(cnpg): Migrate to barman cloud plugin --- charts/atlantis/templates/cluster.yaml | 60 ++++++++++++++----- charts/atlantis/templates/schedule.yaml | 11 ---- .../manifests/objectstore-tos.yaml | 20 ------- 3 files changed, 44 insertions(+), 47 deletions(-) delete mode 100644 charts/atlantis/templates/schedule.yaml delete mode 100644 values/postgres-operator/manifests/objectstore-tos.yaml diff --git a/charts/atlantis/templates/cluster.yaml b/charts/atlantis/templates/cluster.yaml index 6c4a0438..a55b3bff 100644 --- a/charts/atlantis/templates/cluster.yaml +++ b/charts/atlantis/templates/cluster.yaml @@ -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: diff --git a/charts/atlantis/templates/schedule.yaml b/charts/atlantis/templates/schedule.yaml deleted file mode 100644 index 6fb96852..00000000 --- a/charts/atlantis/templates/schedule.yaml +++ /dev/null @@ -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 }} diff --git a/values/postgres-operator/manifests/objectstore-tos.yaml b/values/postgres-operator/manifests/objectstore-tos.yaml deleted file mode 100644 index 13f0e4b9..00000000 --- a/values/postgres-operator/manifests/objectstore-tos.yaml +++ /dev/null @@ -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}}