Connect to Crunchy Operator's read replica

304 views Asked by At

How do I connect to a read replica of a Crunchy Operator postgres cluster, when running this cluster in HA mode?

I have two instances configured and two pgBouncer configured.

k get svc -o wide looks like this

NAME                     TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE   SELECTOR
analytics-ha             ClusterIP   172.16.16.194   <none>        5432/TCP   63d   <none>
analytics-ha-config      ClusterIP   None            <none>        <none>     63d   <none>
analytics-pgbouncer      ClusterIP   172.16.24.181   <none>        5432/TCP   63d   postgres-operator.crunchydata.com/cluster=analytics,postgres-operator.crunchydata.com/role=pgbouncer
analytics-pods           ClusterIP   None            <none>        <none>     63d   postgres-operator.crunchydata.com/cluster=analytics
analytics-primary        ClusterIP   None            <none>        5432/TCP   63d   <none>

Like you can see, there's no -replica svc I can connect to.

1

There are 1 answers

0
Gangadhar Ure On

I tried to create one Vm in the same subnet and im able to access the read replica with same user name password from the VM.