postgres: migrate to backups via the barman plugin

This commit is contained in:
2026-03-16 17:47:21 -04:00
parent 5f939e121b
commit 9281d2f089
4 changed files with 23 additions and 12 deletions

View File

@@ -0,0 +1,15 @@
apiVersion: barmancloud.cnpg.io/v1
kind: ObjectStore
metadata:
name: truenas-s3
spec:
configuration:
destinationPath: "s3://weyma-talos-shared-pgsql-new/"
endpointURL: http://10.105.15.20:9000
s3Credentials:
accessKeyId:
key: s3AccessKey
name: s3-backup-creds
secretAccessKey:
key: s3SecretKey
name: s3-backup-creds

View File

@@ -0,0 +1,25 @@
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
name: s3-backup-creds
spec:
data:
- remoteRef:
conversionStrategy: Default
decodingStrategy: None
key: cloudnativepg
metadataPolicy: None
property: s3_backup_key
secretKey: s3SecretKey
refreshInterval: 1h
secretStoreRef:
kind: ClusterSecretStore
name: weyma-vault
target:
template:
data:
s3AccessKey: fmRuq5b96EKqQOGR1prs
s3SecretKey: "{{ .s3SecretKey }}"
creationPolicy: Owner
deletionPolicy: Retain
name: s3-backup-creds

View File

@@ -0,0 +1,12 @@
apiVersion: postgresql.cnpg.io/v1
kind: ScheduledBackup
metadata:
name: postgres-nightly
spec:
schedule: "0 0 4 * * *"
backupOwnerReference: self
cluster:
name: weyma-pgsql
method: plugin
pluginConfiguration:
name: barman-cloud.cloudnative-pg.io