Repository navigation
fix(cnpg): drop destructive destroy provisioners, default 1.30.1 - #41
Merged
Merged
Conversation
deploy_cloudnativepg_* use cnpg_version as a trigger, so bumping the operator version replaces the null_resource and runs its destroy provisioner: kubectl delete -f cnpg-1.28.0.yaml plus the namespace. That deletes the CNPG CRDs and, through them, every PostgreSQL Cluster, Backup and ScheduledBackup on the cluster. - remove the destroy provisioners (uninstall is manual) - fail the apply if the operator rollout does not complete - default/example operator version 1.30.1 Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Why
null_resource.deploy_cloudnativepg_{nprd,prd,poc}_appshavetriggers = { cnpg_version = var.cloudnativepg_operator_version }. Bumping the version replaces the resource, which runs its destroy provisioner:Deleting that manifest deletes the CNPG CRDs, and with them every
Cluster,Backup,ScheduledBackup,Poolerand the instance PVCs owned by the Clusters (authentik, coder, high-command on prd; harbor on nprd). A routine operator upgrade through Terraform would have wiped the databases.What
kubectl apply --server-sideof the new manifest), which is the documented CNPG upgrade path. Uninstalling CNPG becomes a deliberate manual operation.kubectl rollout statusfor the operator no longer ends in|| true, so a failed upgrade fails the apply.cloudnativepg_operator_version→1.30.1.Part of the UPGRADE_PLAN item CNPG 1.28.0 → 1.30.1. Live rollout: poc (operator only) → nprd (harbor) → prd, with on-demand Backups +
pg_dumpallbeforehand andprimaryUpdateMethod: switchoverset via the gitops PRs.Testing
terraform validatepasses.kubectl apply --server-side --dry-run=server -f cnpg-1.30.1.yamlon poc-apps, nprd-apps, prd-apps: all 26 objects apply, no field-manager conflicts.Made with Cursor