External cluster connection

Hey folks, I am running yugabyte against kubernetes in google cloud.
I followed the instructions at https://docs.yugabyte.com/latest/deploy/public-clouds/gcp/#gke.
How can I connect to this cluster using psql from outside?

If you issue a kubectl get services you should get a response that looks something like this:

NAME            TYPE           CLUSTER-IP      EXTERNAL-IP     PORT(S)                                                       AGE
kubernetes      ClusterIP      10.47.240.1     <none>          443/TCP                                                       3m11s
yb-db-service   LoadBalancer   10.47.243.104   34.74.95.111    9000:32422/TCP,9042:31176/TCP,6379:30622/TCP,5433:31878/TCP   108s
yb-master-ui    LoadBalancer   10.47.245.167   35.231.155.94   7000:32123/TCP                                                111s
yb-masters      ClusterIP      None            <none>          7000/TCP,7100/TCP                                             112s
yb-tservers     ClusterIP      None            <none>          9000/TCP,9100/TCP,9042/TCP,6379/TCP,5433/TCP                  109s

The yb-db-service is a LoadBalancer with an external-ip address (in this case 34.74.95.111) that you can connect to with psql -h 34.74.95.111 -p 5433 -U yugabyte.

Hope this helps.
–Alan

1 Like