Problem
Today the PostgreSQL addon ships a per-pod pgbouncer sidecar (port 6432) using addons/postgresql/config/pgbouncer-ini.tpl mounted as pgbouncer-configuration. Operators often need to tune pool sizing (default_pool_size, related pool limits) and other pgbouncer.ini settings for workload shape and connection storms.
KubeBlocks Reconfiguring OpsRequest only targets postgresql.conf (see templates/paramsdef.yaml: fileName: postgresql.conf). The pgbouncer-configuration config entry in templates/cmpd.yaml has no reconfigure action (unlike postgresql-configuration, which includes postgresql.config.reconfigureAction).
So users cannot adjust pgbouncer via the cluster API after deployment; default_pool_size is not even set in the template, so PgBouncer default (20) applies. That is a real product gap (documented as such in kubeblocks-docs PostgreSQL FAQ §7).
Desired behavior
- First-class support to change pgbouncer parameters (at minimum:
default_pool_size, ideally pool_mode, max_client_conn override, and other common pgbouncer.ini keys) without forking the chart for every cluster.
- Consistent UX with engine reconfiguration: e.g.
OpsRequest type Reconfiguring (or a dedicated operation) with validated parameters and clear reload vs restart semantics for the pgbouncer container.
Suggested implementation sketch
- Add a parameters definition / schema for
pgbouncer.ini (properties format or dedicated constraint), or extend the component config model so pgbouncer keys are valid reconfigures[].parameters for component postgresql.
- Attach
reconfigure lifecycle to pgbouncer-configuration in ComponentDefinition (reload pgbouncer or restart sidecar as appropriate—Bitnami images often support SIGHUP reload for many settings).
- Ensure generated
pgbouncer.ini merges user overrides with templated values (memory-based max_client_conn, etc.).
- Tests / examples: sample
OpsRequest and kbcli path if applicable.
References
addons/postgresql/templates/cmpd.yaml — configs for postgresql-configuration vs pgbouncer-configuration
addons/postgresql/templates/paramsdef.yaml — postgresql.conf only
addons/postgresql/config/pgbouncer-ini.tpl — current template
If this belongs in the main kubeblocks repo instead (core reconfiguring API), please move/relabel; the addon change still needs the pgbouncer config + reload wiring above.
Problem
Today the PostgreSQL addon ships a per-pod pgbouncer sidecar (port 6432) using
addons/postgresql/config/pgbouncer-ini.tplmounted aspgbouncer-configuration. Operators often need to tune pool sizing (default_pool_size, related pool limits) and otherpgbouncer.inisettings for workload shape and connection storms.KubeBlocks
ReconfiguringOpsRequest only targetspostgresql.conf(seetemplates/paramsdef.yaml:fileName: postgresql.conf). Thepgbouncer-configurationconfig entry intemplates/cmpd.yamlhas noreconfigureaction (unlikepostgresql-configuration, which includespostgresql.config.reconfigureAction).So users cannot adjust pgbouncer via the cluster API after deployment;
default_pool_sizeis not even set in the template, so PgBouncer default (20) applies. That is a real product gap (documented as such in kubeblocks-docs PostgreSQL FAQ §7).Desired behavior
default_pool_size, ideallypool_mode,max_client_connoverride, and other commonpgbouncer.inikeys) without forking the chart for every cluster.OpsRequesttypeReconfiguring(or a dedicated operation) with validated parameters and clear reload vs restart semantics for the pgbouncer container.Suggested implementation sketch
pgbouncer.ini(properties format or dedicated constraint), or extend the component config model so pgbouncer keys are validreconfigures[].parametersfor componentpostgresql.reconfigurelifecycle topgbouncer-configurationinComponentDefinition(reloadpgbounceror restart sidecar as appropriate—Bitnami images often supportSIGHUPreload for many settings).pgbouncer.inimerges user overrides with templated values (memory-basedmax_client_conn, etc.).OpsRequestandkbclipath if applicable.References
addons/postgresql/templates/cmpd.yaml—configsforpostgresql-configurationvspgbouncer-configurationaddons/postgresql/templates/paramsdef.yaml—postgresql.confonlyaddons/postgresql/config/pgbouncer-ini.tpl— current templateIf this belongs in the main
kubeblocksrepo instead (core reconfiguring API), please move/relabel; the addon change still needs the pgbouncer config + reload wiring above.