charts icon indicating copy to clipboard operation
charts copied to clipboard

feat(pooler): create Secret and use pooler address in JDBC URL

Open shusaan opened this issue 7 months ago • 1 comments

What the Issue Is

Currently, when enabling the pooler from the Helm chart (values.yaml), the pooler is created successfully, but the generated Secret is not updated to use the pooler endpoint.

Instead, the Secret continues to expose the default PostgreSQL connection URL (postgresql://...) from the cluster.

This means applications cannot automatically connect via the pooler, defeating the purpose of enabling it through the chart.

This behavior has been raised in related issues:


How the Solution Works

Since handling this directly in the operator is more complex and requires deeper architectural changes, this PR provides a Helm chart level solution.

When pooler.enabled = true in values.yaml:

  • A new Secret is generated for the pooler containing:

    • JDBC URL pointing to the pooler service
    • username
    • password
  • The Secret is mapped to the cluster, ensuring workloads can connect using the pooler endpoint instead of the PostgreSQL endpoint.

This approach provides a simpler and more flexible way to expose pooler connectivity without waiting for operator level changes.


Current Scope

  • Implemented Secret generation for a single pooler (e.g., rw pooler).
  • The generated Secret is mapped to the cluster for easy consumption by applications.

Future Improvements (possible next steps)

  • Support for multiple poolers (e.g., ro pooler or custom poolers).
  • Configurable Secret naming convention.

shusaan avatar Sep 21 '25 04:09 shusaan

IMHO this should be directly in the controller instead of the helm chart

I started implementing that a couple of months ago but I haven't finished it yet

ludat avatar Nov 09 '25 21:11 ludat