Commit c4563ba
committed
feat: use FQDN instead of pod IP for Patroni connect_address
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.1 parent 3b13f2f commit c4563ba
3 files changed
Lines changed: 9 additions & 4 deletions
File tree
- stackgres-k8s/src/operator/src/main
- java/io/stackgres/operator/conciliation/factory/cluster/patroni
- resources/templates
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
120 | 123 | | |
121 | | - | |
| 124 | + | |
| 125 | + | |
122 | 126 | | |
123 | 127 | | |
124 | 128 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
| 205 | + | |
| 206 | + | |
206 | 207 | | |
207 | 208 | | |
208 | 209 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
257 | | - | |
| 257 | + | |
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
265 | | - | |
| 265 | + | |
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
| |||
0 commit comments