Upgrade
This page covers upgrading the Alauda build of CloudNativePG operator. PostgreSQL server version upgrades (e.g. PG 17 → PG 18) are a separate concern; see PostgreSQL Major Version Upgrade below.
TOC
Compatibility MatrixUpgrade PathUpgrade StrategyPre-upgrade ChecksOperator Upgrade ProcedurePost-upgrade VerificationRollback ConsiderationsHistorical Recovery: from rc-suffixed buildsRecovery sequencePostgreSQL Major Version UpgradeReferenceCompatibility Matrix
This is the first release. Future minor releases (v1.30.x-acp.x, v2.0.x-acp.x) will extend this matrix.
Refer to Release Notes for version-specific changes, new features, and known limitations.
Upgrade Path
- Patch-level upgrade (within same minor): any direction supported. Example:
v1.29.0-acp.1 → v1.29.0-acp.2. - Minor upgrade: consecutive only. Example:
v1.29.0 → v1.30.0. Skipping minors (e.g.v1.29.0 → v1.31.0) is not supported and may break the OLMreplaceschain. - Major upgrade: read the upstream CNPG release notes for breaking changes; manual CR migration may be required.
Upgrade Strategy
The Subscription's installPlanApproval field controls when upgrades trigger:
- Automatic: OLM applies upgrades immediately when a new CSV is published to the channel. Recommended for non-production environments.
- Manual: OLM creates an InstallPlan but pauses for human approval before applying. Recommended for production. Approve via the platform UI or
kubectl edit installplan -n cnpg-system <name>.
Pre-upgrade Checks
Before triggering an operator upgrade:
-
Verify all Clusters are healthy:
Every Cluster's
STATUSshould beCluster in healthy state. Do not upgrade with a degraded Cluster (in-flight failover, replica lag, or pod-pending state). -
Verify backup is recent (if Barman Cloud plugin is installed):
Most recent successful Backup should be within your RPO window.
-
Verify catalog source health:
Should output
READY. -
Verify CRD compatibility (cross-minor-version upgrade only): Check the new release's notes for CRD field deprecations. Cluster CRs using deprecated fields may fail validation post-upgrade.
Operator Upgrade Procedure
- Push the new package to the cluster's catalog (Marketplace administrator action).
- In Marketplace > Operator Hub, the
cloudnative-pgpackage will show an upgrade indicator. - (Manual approval only) Click the upgrade banner on the operator detail page → Approve InstallPlan.
- Watch the CSV in Operator Hub > Installed Operators. The transition is
Pending→Installing→Replacing→ (old CSV deleted) →Succeeded. - Verify the operator pod has cycled:
Post-upgrade Verification
After the new CSV reaches Succeeded:
-
Operator pod is Running 1/1:
-
Existing Clusters remain healthy:
-
PostgreSQL pods do NOT restart unnecessarily: the operator upgrade itself does NOT rebuild PG pods. PG pods are touched only if the new operator detects a configuration drift requiring rollout (e.g. updated
spec.imageNamereferencing a moved tag). -
CSV envs sanity check (especially after upgrade through a CSV format change):
Rollback Considerations
OLM does NOT support automatic rollback. If an upgrade leaves clusters in a degraded state:
- Don't delete CSVs by hand — that escalates to "upgrade-stuck" recovery (below).
- First, check operator logs:
kubectl logs -n cnpg-system deploy/cnpg-controller-manager. The operator may be reporting reconciliation errors that resolve once the cause is fixed. - If rollback is genuinely needed, manually pin the old CSV via
Subscription.spec.startingCSV. Note this can deadlock with stale state — see the recovery sequence below.
Historical Recovery: from rc-suffixed builds
The CNPG tag convention vMAJOR.MINOR.PATCH-acp.N(-rc.M.gSHA) interacts with OLM's strict SemVer §11 ordering in an unintuitive way: more pre-release identifiers means HIGHER version. So 1.29.0-acp.1-rc.88.ge3a3c0c (5 pre-release ids) ranks ABOVE 1.29.0-acp.1 (2 pre-release ids), inverting the expected "release > pre-release" semantic.
This matters when upgrading from a pre-release -rc.X.gSHA build to a bare release tag. As long as the old rc.X.gSHA ArtifactVersion exists on the cluster, OLM picks it as channel head — opposite of what you want. Combined with the rc-bundle's potentially incorrect replaces: field, automatic upgrades typically deadlock.
Recovery sequence
This recovery sequence is destructive (the operator deployment is briefly absent between steps 4 and 6), but Cluster CRs are not affected — PostgreSQL pods continue running independent of the operator. PG availability is preserved across this window.
If an existing Cluster CR is reconciled by the new operator after step 6 and the operator decides a rolling update is needed (because Cluster.status.currentImage differs from the CSV's POSTGRES_IMAGE_NAME default and the cluster doesn't override imageName), expect a brief replica-cycling but no primary downtime.
PostgreSQL Major Version Upgrade
Operator upgrades and PostgreSQL major version upgrades are independent. The operator can be upgraded without touching PostgreSQL; PostgreSQL major versions can be upgraded without changing operator versions.
CNPG does NOT support in-place PG major version upgrade (e.g. PG 17 → PG 18 in the same Cluster). To migrate a Cluster between major versions:
- Use logical replication (
Subscription+PublicationCRs) to replicate from old-major Cluster to new-major Cluster, then cut over. - Or use backup-and-restore:
pg_dump-style logical export, then restore into a new-major Cluster. - Or use the upstream
cnpg-i-pgupgradeCNPG-I plugin (when available in Alauda distribution).
The fleet-wide PG image version is centralized via ClusterImageCatalog (see Architecture / Image Catalog Model); updating the catalog updates imageCatalogRef-using Clusters but does NOT trigger a major-version upgrade — only minor/patch updates within the same major.
Reference
- Operator upgrade flow upstream: CloudNativePG operator upgrade
- PostgreSQL major version upgrade upstream: CloudNativePG declarative database
- ACP
violet pushworkflow: Marketplace administrator's guide (your platform admin should have access)