Skip to content

Commit 0aa7517

Browse files
committed
fix(patroni): explicitly exposes patroni rest API port
Signed-off-by: Juliana Oliveira <[email protected]>
1 parent 63868d6 commit 0aa7517

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

internal/controller/postgrescluster/cluster.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,19 @@ func (r *Reconciler) reconcileClusterPodService(
8282
naming.LabelCluster: cluster.Name,
8383
}
8484

85+
patroniPort := int32(8008)
86+
if cluster.Spec.Patroni != nil && cluster.Spec.Patroni.Port != nil {
87+
patroniPort = int32(*cluster.Spec.Patroni.Port)
88+
}
89+
90+
clusterPodService.Spec.Ports = []corev1.ServicePort{
91+
{
92+
Name: "patroni-api",
93+
Port: patroniPort,
94+
Protocol: corev1.ProtocolTCP,
95+
},
96+
}
97+
8598
if err == nil {
8699
err = errors.WithStack(r.apply(ctx, clusterPodService))
87100
}

0 commit comments

Comments
 (0)