Skip to content

feat(postgresql): add standalone PgBouncer component - #3429

Draft
ldming wants to merge 3 commits into
mainfrom
support/issue-20276-pgbouncer
Draft

feat(postgresql): add standalone PgBouncer component#3429
ldming wants to merge 3 commits into
mainfrom
support/issue-20276-pgbouncer

Conversation

@ldming

@ldming ldming commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

What

  • Add replication-direct and replication-pgbouncer topologies while preserving the legacy replication topology.
  • Run PgBouncer as an independent stateless component and Service on port 6432; keep PostgreSQL direct access on port 5432.
  • Create the PgBouncer auth user and SECURITY DEFINER auth function only for the pooler backend.
  • Validate the auth_query path with a separate low-privilege pgbouncerprobe account.
  • Productize session pooling parameters and image digest and pull-policy controls.
  • Advance the PostgreSQL Addon chart to 1.2.0-alpha.4.

Verification

  • Targeted ShellSpec: 25 examples, 0 failures.
  • Helm lint and default and digest rendering contracts pass.
  • ShellCheck at the repository error severity and bash syntax checks pass.
  • CUE validation and git diff checks pass.
  • Independent review closed the ShellSpec contract and auth_query readiness findings.

Compatibility

  • Existing replication clusters retain the historical in-pod PgBouncer sidecar.
  • New product integrations select replication-direct or replication-pgbouncer.
  • The first supported pool mode is session.

Known limits

  • Client-to-pooler and pooler-to-PostgreSQL TLS are outside this MVP.
  • Online enable or disable is outside this MVP.
  • KubeBlocks system-account password rotation does not yet trigger automatic PgBouncer reload or rollout.
  • The current default image remains apecloud/pgbouncer:1.19.0; a newer scanned image and pinned release digest are still required before GA.
  • Real KubeBlocks 1.2 runtime, failover, backup and restore, and password-rotation validation are not included in this PR.
  • APIServer and Console work is intentionally excluded and will start only after this Addon PR is merged.

Related to apecloud/apecloud#20276

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 27 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (ce67f5a) to head (9ee9c1b).

Files with missing lines Patch % Lines
...tgresql/scripts-ut-spec/pgbouncer_authfile_spec.sh 0.00% 18 Missing ⚠️
...postgresql/scripts-ut-spec/kb_api_contract_spec.sh 0.00% 8 Missing ⚠️
...ostgresql/scripts-ut-spec/metrics_contract_spec.sh 0.00% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main   #3429   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files        192     192           
  Lines      27227   27128   -99     
=====================================
+ Misses     27227   27128   -99     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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