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     <none>          443/TCP                                                       3m11s
yb-db-service   LoadBalancer    9000:32422/TCP,9042:31176/TCP,6379:30622/TCP,5433:31878/TCP   108s
yb-master-ui    LoadBalancer   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 that you can connect to with psql -h -p 5433 -U yugabyte.

Hope this helps.

1 Like