Skip to content

Add Postgres 12→14 in-place upgrade script for CircleCI Server#79

Open
soulchips wants to merge 2 commits into
mainfrom
onprem-3305/pg-14-upgrade-script
Open

Add Postgres 12→14 in-place upgrade script for CircleCI Server#79
soulchips wants to merge 2 commits into
mainfrom
onprem-3305/pg-14-upgrade-script

Conversation

@soulchips
Copy link
Copy Markdown
Contributor

@soulchips soulchips commented May 13, 2026

upgrade-postgres-to-14.sh renders and applies a one-shot pg_upgrade --link Job against the existing postgres PVC, then prints the helm values block and helm upgrade command operators need to roll forward.

The script auto-discovers PVC, secret, and source-cluster encoding/locale, verifies the application layer is scaled to 0, scales the postgres StatefulSet down itself, and streams Job logs until the Complete condition is observed. Defaults pull from ACR; --dockerhub switches to Docker Hub. Flags cover encoding/locale overrides, custom tags, and dry-run rendering.

README documents the full end-to-end procedure (snapshot, quiesce, run, helm upgrade, validate, clean up), what the script intentionally does NOT do (backups, app-layer scaling, helm upgrade), and troubleshooting for the common pg_upgrade failure modes — locale mismatch, missing extensions, re-running after a failed Job.

ONPREM-3305

⚙️ Issue

Fix

Tests

  • Tested Updating Existing Instance
  • Installed on new instance

soulchips and others added 2 commits May 13, 2026 02:15
upgrade-postgres-to-14.sh renders and applies a one-shot pg_upgrade
--link Job against the existing postgres PVC, then prints the helm
values block and helm upgrade command operators need to roll forward.

The script auto-discovers PVC, secret, and source-cluster
encoding/locale, verifies the application layer is scaled to 0,
scales the postgres StatefulSet down itself, and streams Job logs
until the Complete condition is observed. Defaults pull from ACR;
--dockerhub switches to Docker Hub. Flags cover encoding/locale
overrides, custom tags, and dry-run rendering.

README documents the full end-to-end procedure (snapshot, quiesce,
run, helm upgrade, validate, clean up), what the script intentionally
does NOT do (backups, app-layer scaling, helm upgrade), and
troubleshooting for the common pg_upgrade failure modes — locale
mismatch, missing extensions, re-running after a failed Job.

ONPREM-3305

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Double-quote $PV_FOR_SCALE inside the kubectl jsonpath so shellcheck
stops flagging it as susceptible to word-splitting/globbing. The
substituted value is a Kubernetes-generated PV name with no
whitespace or glob characters, so behavior is unchanged — this is
just to keep the shellcheck CI job green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant