Reputation: 1386
I have deployed my crunchy db postgresq on my Kubernetes cluster.
However, I am not sure how to connect to the database remotely.
What command can I use to connect remotely so I can create a new database?
Is there a kubectl command to go with psql?
Upvotes: 9
Views: 7598
Reputation: 11445
kubctl get pods
kubectl exec -it <POD_NAME> bash
su postgres
psql
in the above postgres is user name. you will get:
postgres=#
Upvotes: 3
Reputation: 1386
I was able to look at another forum and found what I needed. I executed with the pod name and gets me to a bash prompt.
kubectl exec -it <POD_NAME> bash
Upvotes: 12