I can access a psql command prompt for a postgres server using kubernetes and kubectl.
I do so by running a command like so:
kubectl -n mynamespace exec -it some_pod --container someContainer -- /bin/bash -c "$CMD"
where CMD is like the following:
export PGPASSWORD='MY_PASSWORD_HERE'; ./pgsql/bin//psql postgresql://someServer:5432/mydb -U myuser
This is all scripted, so with no effort, I can access a terminal based client for postgres.
Of course I'd prefer to do this with Datagrip if possible, but am unsure how to access the server with this setup, which I can't really get changed. I've tried putting this into the Datagrip datasource dialogs, but haven't seen if it's possible yet. I feel it may require a port forward in some fashion, but no luck as of yet.
Any suggestions? Thanks!
Note that I feel this is probalby more of a kubernetes question than a Datagrip one, but thought I might be wrong, lol.