Skip to content

feat(cluster): wire serviceTemplate through the Pooler template#948

Open
philippemnoel wants to merge 1 commit into
cloudnative-pg:mainfrom
paradedb:expose-pooler-serviceTemplate
Open

feat(cluster): wire serviceTemplate through the Pooler template#948
philippemnoel wants to merge 1 commit into
cloudnative-pg:mainfrom
paradedb:expose-pooler-serviceTemplate

Conversation

@philippemnoel

Copy link
Copy Markdown
Contributor

What

  • Passes CloudNativePG Pooler.spec.serviceTemplate through the cluster chart via poolers[].serviceTemplate.
  • Documents the field in values.yaml and fixes the README row, which already listed poolers[].serviceTemplate as a ServiceTemplateSpec even though the template never rendered it.
  • Extends the pooler chainsaw test to render and assert the new block.

Why

The Pooler template only passed through template (the PgBouncer deployment PodTemplateSpec), so there was no way to customize the Service the pooler creates without bypassing the chart. CloudNativePG exposes Pooler.spec.serviceTemplate for exactly this, and the chart's README already advertised poolers[].serviceTemplate, so the field was documented but non-functional.

Setting serviceTemplate lets chart users control the pooler Service type, annotations, and labels, for example to front the pooler with an internal NLB for AWS PrivateLink, without dropping down to hand-written kubernetes_service resources alongside the chart.

Backwards compatibility

poolers[].serviceTemplate is unset by default, and the template uses {{- with ... }}, so the block is omitted entirely when not provided. Existing poolers render identically.

Tests

  • helm lint charts/cluster
  • helm template test charts/cluster --show-only templates/pooler.yaml (no serviceTemplate rendered by default)
  • helm template test charts/cluster --show-only templates/pooler.yaml --values charts/cluster/test/pooler/01-pooler_cluster.yaml (renders serviceTemplate on the rw pooler, omits it on the ro pooler)
  • The pooler chainsaw test now asserts the rendered serviceTemplate block on the rw Pooler.

The Pooler template only passed through `template` (the pgbouncer
deployment), so a pooler's Service could not be customized from chart
values even though the README already advertised `poolers[].serviceTemplate`.

Pass `serviceTemplate` through to the CNPG Pooler spec so the pooler
Service can set its type (for example LoadBalancer), annotations, and
labels. Document the field in values.yaml, fix the mislabeled README row,
and extend the pooler chainsaw test to render and assert it.

Signed-off-by: Philippe Noël <philippemnoel@gmail.com>
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jul 12, 2026
philippemnoel added a commit to paradedb/charts that referenced this pull request Jul 13, 2026
The Pooler template only exposed `template` (the pgbouncer deployment),
so a pooler's Service could not be customized via chart values even
though the README already listed `poolers[].serviceTemplate`. This adds
the `serviceTemplate` passthrough, matching CNPG's Pooler spec, so the
pooler Service can be made a LoadBalancer (type + AWS NLB annotations).
Documents the field in values.yaml, fixes the mislabeled README row, and
asserts it in the pooler test.

This unblocks values-driven PrivateLink in paradedb/cloud, where every
customer cluster is expressed as chart values rather than out-of-band
Terraform Services.

Mirrors the upstream change proposed in cloudnative-pg#948.

Claude-Session: https://claude.ai/code/session_01RVg7zztPzKfJvEGwo12dUb
@NiccoloFei NiccoloFei added the chart( cluster ) Related to the cluster chart label Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chart( cluster ) Related to the cluster chart size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants