1

I am using docker swarm to manage my stacks. And I dont want to expose my databases to the public (5432 port on the host machine should not be open), but I still want to use dbeaver or pgadmin.

The problem is that docker swarm cannot expose a container port only to 127.0.0.1 but will expose it to 0.0.0.0. So I cannot simly tunnel via ssh to my database server and connect to localhost:5432.

My idea was to have a setup where a jumphost (docker container) sits between me and my database.

Client --SSH--> Jumphost (Container) ----> Database (Postgres container)

However, this does not work with dbeaver or pgadmin. When I do a ssh tunnel to the jumphost and then enter my database credentials I get a Connection reset error. SSH tunneling works.

Does anyone else has a similar setup? How did you solve this?

0

You must log in to answer this question.

Browse other questions tagged .