Repository navigation
chore(cnpg): roll high-command primary by switchover - #16
Merged
Merged
Conversation
primaryUpdateMethod restart -> switchover on high-command-postgres so operator upgrades promote an updated replica instead of restarting the primary in place.
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.


CloudNativePG rolls every instance on operator upgrades and on spec changes that need a restart. With
primaryUpdateMethod: restartthe primary is restarted in place, so the database is down until it comes back. On 2026-10-04 that took Authentik SSO down for about 4 minutes (server pods hit their liveness probe while the primary restarted).switchoverupdates the replicas first, then promotes an updated replica and only then recreates the old primary. Clients see one short reconnect (seconds).This only changes the Cluster spec, not the pod template, so merging it does not roll any pods. It is a prerequisite for the CNPG operator upgrade 1.28.0 → 1.30.1 (rancher-deploy UPGRADE_PLAN item #3).
Cluster:
high-command/high-command-postgres(prd-apps). The manifest mirrors live (Fleet adopted it), so only this one field changes.Note
Low Risk
Single Cluster spec field with no immediate pod rollout; lowers outage risk during future CNPG-managed primary updates on production Postgres.
Overview
Sets
primaryUpdateMethodon thehigh-command-postgresCloudNativePG cluster fromrestarttoswitchover, so future operator-driven primary updates roll replicas first, promote an updated replica, then rebuild the old primary instead of restarting the primary in place.That avoids multi-minute primary downtime (e.g. Authentik SSO during a 2026-10-04 incident) in favor of a brief client reconnect. Merging only updates the Cluster spec—no pod template change—so it does not roll instances now; it prepares the cluster for the planned CNPG operator upgrade (1.28.0 → 1.30.1).
Reviewed by Cursor Bugbot for commit 8357295. Bugbot is set up for automated code reviews on this repo. Configure here.