From 6e8a061b9472b9ae2020d1d8e441ddfd51b0a1a9 Mon Sep 17 00:00:00 2001 From: Ben Vincent Date: Thu, 30 Jul 2026 22:16:18 +1000 Subject: [PATCH] cephrgw: allow purge-on-delete for cnpg backup buckets (#313) Step 1 of moving the CNPG backup buckets to ec placement: RGW can't move an existing bucket, so they must be dropped and recreated. This lets the operator actually delete the buckets (with their objects) when the CRs are removed in step 2. - set retainOnDelete: false and purgeOnDelete: true on all nine cnpg backup Bucket CRs - leave ObjectStoreUser/BucketAccess untouched so the backup-s3 secrets persist Reviewed-on: https://git.unkin.net/unkin/argocd-apps/pulls/313 Co-authored-by: Ben Vincent Co-committed-by: Ben Vincent --- apps/base/artifactapi/cnpg_backup.yaml | 3 ++- apps/base/authentik/cnpg_backup.yaml | 3 ++- apps/base/encapi/cnpg_backup.yaml | 3 ++- apps/base/grafana/cnpg_backup.yaml | 3 ++- apps/base/litellm/cnpg_backup.yaml | 3 ++- apps/base/netbox/cnpg_backup.yaml | 3 ++- apps/base/paperclip/cnpg_backup.yaml | 3 ++- apps/base/puppet/cnpg_backup.yaml | 3 ++- apps/base/woodpecker/cnpg_backup.yaml | 3 ++- 9 files changed, 18 insertions(+), 9 deletions(-) diff --git a/apps/base/artifactapi/cnpg_backup.yaml b/apps/base/artifactapi/cnpg_backup.yaml index e96d678..5232f5e 100644 --- a/apps/base/artifactapi/cnpg_backup.yaml +++ b/apps/base/artifactapi/cnpg_backup.yaml @@ -36,7 +36,8 @@ spec: app: artifactapi purpose: cnpg-backup # Never drop the backups if the CR is removed; retire buckets by hand. - retainOnDelete: true + retainOnDelete: false + purgeOnDelete: true --- # Nightly base backup. Continuous WAL archiving is always-on via the Cluster's # spec.backup.barmanObjectStore; this schedules the periodic full backup that diff --git a/apps/base/authentik/cnpg_backup.yaml b/apps/base/authentik/cnpg_backup.yaml index a10a041..17c3fd4 100644 --- a/apps/base/authentik/cnpg_backup.yaml +++ b/apps/base/authentik/cnpg_backup.yaml @@ -36,7 +36,8 @@ spec: app: authentik purpose: cnpg-backup # Never drop the backups if the CR is removed; retire buckets by hand. - retainOnDelete: true + retainOnDelete: false + purgeOnDelete: true --- # Nightly base backup. Continuous WAL archiving is always-on via the Cluster's # spec.backup.barmanObjectStore; this schedules the periodic full backup that diff --git a/apps/base/encapi/cnpg_backup.yaml b/apps/base/encapi/cnpg_backup.yaml index a03ca84..2d7c225 100644 --- a/apps/base/encapi/cnpg_backup.yaml +++ b/apps/base/encapi/cnpg_backup.yaml @@ -36,7 +36,8 @@ spec: app: encapi purpose: cnpg-backup # Never drop the backups if the CR is removed; retire buckets by hand. - retainOnDelete: true + retainOnDelete: false + purgeOnDelete: true --- # Nightly base backup. Continuous WAL archiving is always-on via the Cluster's # spec.backup.barmanObjectStore; this schedules the periodic full backup that diff --git a/apps/base/grafana/cnpg_backup.yaml b/apps/base/grafana/cnpg_backup.yaml index 654d23b..21d3309 100644 --- a/apps/base/grafana/cnpg_backup.yaml +++ b/apps/base/grafana/cnpg_backup.yaml @@ -36,7 +36,8 @@ spec: app: grafana purpose: cnpg-backup # Never drop the backups if the CR is removed; retire buckets by hand. - retainOnDelete: true + retainOnDelete: false + purgeOnDelete: true --- # Nightly base backup. Continuous WAL archiving is always-on via the Cluster's # spec.backup.barmanObjectStore; this schedules the periodic full backup that diff --git a/apps/base/litellm/cnpg_backup.yaml b/apps/base/litellm/cnpg_backup.yaml index 05710b0..4beb5a9 100644 --- a/apps/base/litellm/cnpg_backup.yaml +++ b/apps/base/litellm/cnpg_backup.yaml @@ -36,7 +36,8 @@ spec: app: litellm purpose: cnpg-backup # Never drop the backups if the CR is removed; retire buckets by hand. - retainOnDelete: true + retainOnDelete: false + purgeOnDelete: true --- # Nightly base backup. Continuous WAL archiving is always-on via the Cluster's # spec.backup.barmanObjectStore; this schedules the periodic full backup that diff --git a/apps/base/netbox/cnpg_backup.yaml b/apps/base/netbox/cnpg_backup.yaml index bb4e2fd..b022bb2 100644 --- a/apps/base/netbox/cnpg_backup.yaml +++ b/apps/base/netbox/cnpg_backup.yaml @@ -32,7 +32,8 @@ spec: tags: app: netbox purpose: cnpg-backup - retainOnDelete: true + retainOnDelete: false + purgeOnDelete: true --- apiVersion: postgresql.cnpg.io/v1 kind: ScheduledBackup diff --git a/apps/base/paperclip/cnpg_backup.yaml b/apps/base/paperclip/cnpg_backup.yaml index 19660f2..6e9b3f9 100644 --- a/apps/base/paperclip/cnpg_backup.yaml +++ b/apps/base/paperclip/cnpg_backup.yaml @@ -36,7 +36,8 @@ spec: app: paperclip purpose: cnpg-backup # Never drop the backups if the CR is removed; retire buckets by hand. - retainOnDelete: true + retainOnDelete: false + purgeOnDelete: true --- # Nightly base backup. Continuous WAL archiving is always-on via the Cluster's # spec.backup.barmanObjectStore; this schedules the periodic full backup that diff --git a/apps/base/puppet/cnpg_backup.yaml b/apps/base/puppet/cnpg_backup.yaml index 0251a81..2e1412b 100644 --- a/apps/base/puppet/cnpg_backup.yaml +++ b/apps/base/puppet/cnpg_backup.yaml @@ -36,7 +36,8 @@ spec: app: puppet purpose: cnpg-backup # Never drop the backups if the CR is removed; retire buckets by hand. - retainOnDelete: true + retainOnDelete: false + purgeOnDelete: true --- # Nightly base backup. Continuous WAL archiving is always-on via the Cluster's # spec.backup.barmanObjectStore; this schedules the periodic full backup that diff --git a/apps/base/woodpecker/cnpg_backup.yaml b/apps/base/woodpecker/cnpg_backup.yaml index 7dd023e..b21c2ee 100644 --- a/apps/base/woodpecker/cnpg_backup.yaml +++ b/apps/base/woodpecker/cnpg_backup.yaml @@ -36,7 +36,8 @@ spec: app: woodpecker purpose: cnpg-backup # Never drop the backups if the CR is removed; retire buckets by hand. - retainOnDelete: true + retainOnDelete: false + purgeOnDelete: true --- # Nightly base backup. Continuous WAL archiving is always-on via the Cluster's # spec.backup.barmanObjectStore; this schedules the periodic full backup that