Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Docker swarm load balancing not working over private network #36689
Problem is probably similar to #25325. Docker can't reach containers from hostB when I query hostA public address.
I'm using Docker swarm with 2 hosts, they are connected via wireguard tunnel and are reachable to each other. I'm able to ping those hosts from each other using internal addresses.
Then I initialize swarm mode using
But when I create service with 2 replicas, I'm facing strange behavior, accessing service via one of public IPs, I'm able to reach only containers which are running on this particular node. Other requests fail with timeout.
Steps to reproduce the issue:
Describe the results you received:
As I said, requests to containers on other nodes fail:
Describe the results you expected:
I expect to be able to reach all of running containers by querying public address of any single node.
Additional information you deem important (e.g. issue happens only occasionally):
It seems to me that wireguard/tunnel itself is not the cause as I still able to send pings between containers. For example, containerB can reach those containerA addresses:
Due to using
I tried to install
I also attempted to apply various fixes (e.g. turn off masquerading, re-create default bridge with lower MTU, set default bind IP, etc), but got no luck.
I reproduced the issue 3 already times with clean setup and ready to provide collaborators access to my test hosts if you would like to investigate onsite.
Same on both hosts:
Additional environment details (AWS, VirtualBox, physical, etc.):
Wireguard setup guide (assuming you installed it):
Servers should be reachable via internal addresses in a moment after this steps.
Yes, the issue still persists for current wireguard (0.0.20180910-wg1) and docker-ce (18.06.1-ce).
I have 2 nodes, both are are active and reachable over internal addresses but every 2nd request to docker service fails.
Sadly, I stuck at the same point. Could not figure out what blocks requests between docker nodes.