Hive
feat(infra): install Barman Cloud Plugin everywhere + flag-gated backup migration (default off)
GitHub issue · Closed
What this does
The CNPG operator catch-up is done (prod runs 1.29.1). This PR is the groundwork for moving backups off the deprecated in-tree barmanObjectStore to the Barman Cloud Plugin (CNPG-I), plus the README “catch-up complete” cleanup. It does not change any backups on merge — it installs the plugin and adds a flag-gated cutover path that’s default off.
Three parts:
-
Install the plugin on every cluster. Adds the official
plugin-barman-cloudchart (0.7.0, samecloudnative-pgHelm repo as the operator) as aplatformchart dependency, toggled byplugin-barman-cloud.enabled(on by default for managed clusters). As a subchart of theplatformrelease it installs into theplatformnamespace alongside the operator — where the plugin must run — so the existinghelm upgradeininstall-platform.shbrings it up; no separate apply step. The plugin is idle until aClusteropts in, so installing it changes nothing about backups. -
Flag-gated cutover templating (
…backup.plugin.enabled, defaultfalse) for both CNPG clusters (tuist+tuist-ops). Off = the existing in-treebarmanObjectStore, unchanged. On = anObjectStoreCR (same bucket/creds/wal/data, retention moved onto it) +Cluster.spec.plugins+ScheduledBackupmethod: plugin, withserverNamepinned to the cluster name so the plugin continues the existing archive prefix. -
Docs. README upgrade-path section rewritten to current state (operator 1.29.1; no catch-up history), plus the plugin install + cutover runbook.
Why split install from enable
The flag-on deploy renders kind: ObjectStore; if the plugin’s CRD isn’t present yet, that deploy fails. So the plugin must be installed everywhere first. Shipping the install ahead of any flag flip removes that ordering hazard and is safe (idle until referenced).
Rollout plan (after this merges)
- Merge this → plugin installed on all envs, backups unchanged.
- Flip canary (
plugin.enabled: trueinvalues-managed-canary.yaml, separate PR). Then verify on canary that WAL archiving continues to the sames3://…/<serverName>path with no errors andpg_walisn’t piling up. - Flip prod + staging once canary is confirmed, and run a restore drill from a plugin-written backup.
Reversible the whole way: flip the flag back and in-tree archiving resumes (in-tree still works on 1.29). Canary first, not all-at-once, specifically to avoid a silent WAL-archiving break reaching prod (the failure mode behind a prior incident: archiving stalls -> pg_wal fills -> Postgres won’t start).
Validation
- Plugin install:
helm templaterenders theplugin-barman-cloudchart cleanly as a subchart ofplatform— nocnpg-systemhardcodes, lands in the release namespace, and its resources are release-prefixed, so it co-locates with the operator without the cross-release conflict in charts#792 (which is about two separate Helm releases). On a brand-new cluster the plugin’s cert-manager Certificate and cert-manager itself apply in the same upgrade;install-platform.shis idempotent and re-runs every deploy, so any first-pass ordering blip self-heals (our existing clusters already run cert-manager, so it is a non-issue there). helm templaterenders both charts in both flag states (off = unchanged in-tree; on =plugins+ObjectStore+method: plugin).- Default-off + idle plugin = no rendered backup change on either cluster on merge.
🤖 Generated with Claude Code
Investigate, reproduce, or fix this item in an isolated repository. Each Flight preserves its outcome and agent session.
Start a Flight and preserve its objective, outcome, and session here.
No GitHub comments yet.