Skip to content

feat: use FQDN instead of pod IP for Patroni connect_address#13

Closed
marcelozani wants to merge 1 commit intoongres:mainfrom
marcelozani:feat/patroni-fqdn-connect-address
Closed

feat: use FQDN instead of pod IP for Patroni connect_address#13
marcelozani wants to merge 1 commit intoongres:mainfrom
marcelozani:feat/patroni-fqdn-connect-address

Conversation

@marcelozani
Copy link

This change fixes Citus metadata sync issues where nodes register in pg_dist_node with ephemeral pod IPs. When pods restart and get new IPs, the stale IPs in pg_dist_node cause metadata synchronization to fail.

Changes:

  • PatroniConfigMap.java: Added PATRONI_CONFIG_SERVICE_NAME and PATRONI_POD_NAMESPACE env vars, changed PATRONI_POSTGRESQL_CONNECT_ADDRESS to use FQDN pattern
  • PatroniEnvironmentVariables.java: Changed PATRONI_RESTAPI_CONNECT_ADDRESS to use FQDN pattern
  • start-patroni.sh: Changed connect_address in restapi and postgresql sections to use the FQDN-based env vars instead of PATRONI_KUBERNETES_POD_IP

The FQDN pattern used is:
${POD_NAME}.${PATRONI_CONFIG_SERVICE_NAME}.${PATRONI_POD_NAMESPACE}.svc.cluster.local

This ensures stable node registration that survives pod restarts.

This change fixes Citus metadata sync issues where nodes register in
pg_dist_node with ephemeral pod IPs. When pods restart and get new IPs,
the stale IPs in pg_dist_node cause metadata synchronization to fail.

Changes:
- PatroniConfigMap.java: Added PATRONI_CONFIG_SERVICE_NAME and
  PATRONI_POD_NAMESPACE env vars, changed PATRONI_POSTGRESQL_CONNECT_ADDRESS
  to use FQDN pattern
- PatroniEnvironmentVariables.java: Changed PATRONI_RESTAPI_CONNECT_ADDRESS
  to use FQDN pattern
- start-patroni.sh: Changed connect_address in restapi and postgresql
  sections to use the FQDN-based env vars instead of PATRONI_KUBERNETES_POD_IP

The FQDN pattern used is:
${POD_NAME}.${PATRONI_CONFIG_SERVICE_NAME}.${PATRONI_POD_NAMESPACE}.svc.cluster.local

This ensures stable node registration that survives pod restarts.
@github-actions
Copy link

github-actions bot commented Feb 4, 2026

This repository is just a mirror and does not accept pull requests, the primary repository is located at https://gitlab.com/ongresinc/stackgres

@github-actions github-actions bot closed this Feb 4, 2026
@github-actions github-actions bot locked and limited conversation to collaborators Feb 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant