Hey I need some help communicating between containers across nodes in swarm.
Cannot resolve service names on different swarm nodes
Run on manager:
docker network create -d overlay --attachable mynetwork
docker service create --replicas 3 --name my-web --constraint "node.role==manager" --network mynetwork nginx
docker service create --constraint="node.role==manager" --name my-busybox --network mynetwork busybox sleep 3000
inside busybox on manager node nslookup my-web
succeeds and finds IP for my-web
docker service rm my-busybox
docker service create --constraint="node.role==worker" --name my-busybox --network mynetwork busybox sleep 3000
Run on worker:
inside busybox on worker node nslookup my-web
fails to find IP for my-web
Note:
-
When there are replicas of
my-web
on the worker node (no constraints on my-web service) the name can be resolved
Any ideas?
Thanks