Skip to content

feat(balancer): declare the cnpg balancer role and Database - #226

Merged
themightychris merged 2 commits into
mainfrom
feat/balancer-cnpg-database
Sep 28, 2026
Merged

themightychris merged 2 commits into
mainfrom
feat/balancer-cnpg-database

Conversation

@themightychris

Copy link
Copy Markdown
Member

Supersedes #183: @TineoC's commit rebased onto current main (which now has cnpg 1.30.1, the Barman Cloud plugin and GCS backups), plus the sealed credentials it was blocked on.

  • shared-cluster gains managed.roles: balancer with passwordSecret: balancer-db-credentials.
  • cloudnative-pg.secrets/balancer-db-credentials.yaml: the role's password, sealed against the live controller. It lands in the same deploy as the role, so the reconcile-nudge from feat(balancer): declare the cnpg balancer role and Database #183's description shouldn't be needed.
  • Database/balancer on shared-cluster, owned by balancer, with the vector extension. Empty until the RDS dump is restored into it.
  • balancer/ splits into app/ + cnpg/ to match sandbox. The app kustomization and its holomapping move unchanged.

Still no cutover: the app's sealed SQL_HOST is untouched and production keeps reading from RDS.

Projection QA

git diff --name-status origin/deploys/k8s-manifests <projection>: 3 files in cloudnative-pg: the Cluster gains managed.roles; Database/balancer and SealedSecret/balancer-db-credentials are new. The balancer namespace's rendered manifests are byte-identical before and after the split.

🤖 Generated with Claude Code

TineoC and others added 2 commits September 28, 2026 15:55
Second half of standing cnpg up for Balancer (CodeForPhilly/balancer-main#526).
Creates an empty `balancer` database on shared-cluster with pgvector enabled,
so the RDS dump has somewhere to be restored to. Still no cutover: the app's
sealed SQL_HOST is untouched and production keeps reading from RDS.

Splits balancer/ into app/ + cnpg/ to match cfp-sandbox-cluster. The Database CR
has to stay in the cloudnative-pg namespace — cnpg requires it to sit beside the
Cluster it targets — so it cannot live under the kustomization that rewrites
everything to `balancer`. The existing kustomization moves to app/ unchanged,
along with its holomapping.

The managed role names balancer-db-credentials, which must be sealed into
cloudnative-pg.secrets/ before this merges or cnpg will report a role reconcile
error. Note cnpg does not pick up a newly-created passwordSecret on its periodic
resync — force it with:

  kubectl annotate cluster -n cloudnative-pg shared-cluster \
    cnpg.io/reconciliationLoop="$(date +%s)" --overwrite

Refs CodeForPhilly/balancer-main#526, CodeForPhilly/cfp-sandbox-cluster#162
Password for the managed balancer role on shared-cluster. Generated locally,
sealed against the live controller, never stored elsewhere — at cutover read
it back from the unsealed Secret in-cluster.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@themightychris
themightychris requested a review from a team as a code owner September 28, 2026 19:57
@TineoC

TineoC commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

LGMT

@themightychris
themightychris merged commit beb4c59 into main Sep 28, 2026
@themightychris
themightychris deleted the feat/balancer-cnpg-database branch September 28, 2026 20:09
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.

2 participants