Hi everyone,
I’m discovering Docker Swarm and I’m struggling to deploy services in an overlay network (and make it work).
I’m using docker stack deploy -c config.yml studio
with this simple compose file
version: "3.4"
services:
redis:
image: redis
db:
image: postgres
networks:
default:
attachable: true
driver: overlay
internal: false
The services are well deployed across my 2 nodes (1 service on each node), but the weird thing starts now.
I run watch -n 1 docker network inspect studio_default
on the manager to have real-time status of my network, and I noticed that in the Peers
field, the worker node appears and disappears randomly, so the service deployed on the node is “randomly available/reachable”.
Why the node disconnects itself from the network (and reconnects) ?
I can ping from the manager container to the worker one when the node appears in the Peers
, but I think I can’t even ping from the worker to the manager…
I’m lost