I have a swarm that has two nodes. When I deploy a stack on the swarm that publishes a port and is replicated only once, I would expect that regardless of where the container is replicated (either node A or B), that I would be able to access it via the swarm host on the published port?
In other words: If the swarm host is “docker-host-a” and a worker is “docker-node-b”, and the swarm host determined it best to replicate the container on “docker-node-b” on port “7071”, I would expect that I could access the container/application at docker-host-a:7071 and it would do some internal routing to docker-node-b:7071 because that’s where it replicated it to…
However, that doesn’t seem to be the case. It seems that I need to know where the swarm decided to replicate the container, because docker-host-a:7071 does not respond when it’s replicated on “docker-node-b”.
Can someone clarify either
- What my misunderstanding is or
- What my mis-configuration is?
FYI: Firewall is not a problem on either the host node or the swarm node. All outbound traffic is allowed on the firewall for these two nodes, only inbound traffic is limited.