From 3996cdc1129293d474f313a991087643442d3819 Mon Sep 17 00:00:00 2001 From: FYWinds Date: Wed, 12 Aug 2026 12:08:09 -0400 Subject: [PATCH] feat: daily volume-snapshot backup for wynnsource-pg - backup.volumeSnapshot via the longhorn-snapshot VolumeSnapshotClass (snapshot-controller now runs in the cluster) - daily ScheduledBackup at 03:15; retention handled centrally by the cnpg-backup-prune CronJob in cnpg-system (keeps newest 14) - explicit storageClass and resource requests, matching the conventions now used by the gitea/zitadel clusters in k3s-gitops --- deploy/base/postgres.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/deploy/base/postgres.yaml b/deploy/base/postgres.yaml index 455bf80..2709640 100644 --- a/deploy/base/postgres.yaml +++ b/deploy/base/postgres.yaml @@ -6,8 +6,13 @@ metadata: argocd.argoproj.io/sync-wave: "0" spec: instances: 1 + resources: + requests: + cpu: 50m + memory: 256Mi storage: size: 5Gi + storageClass: longhorn postgresql: parameters: max_connections: "100" @@ -15,3 +20,17 @@ spec: initdb: database: wcs_db owner: wynnsource + backup: + volumeSnapshot: + className: longhorn-snapshot +--- +apiVersion: postgresql.cnpg.io/v1 +kind: ScheduledBackup +metadata: + name: wynnsource-pg-daily +spec: + schedule: "0 15 3 * * *" + backupOwnerReference: self + cluster: + name: wynnsource-pg + method: volumeSnapshot