I am running into interesting situation, everything worked couple of weeks back but now my swarm if behaving strange. I have swarm with two nodes, one is manager (ip = x.y.z.100) another is worker (ip = x.y.z.101)
I run stack deploy using following docker-stack.yml
version: "3" services: my-app: image: my-app ports: - "8090:8080" deploy: mode: replicate replicas: 2 labels: [APP=MY-APP] update_config: parallelism: 2 restart_policy: condition: on-failure placement: constraints: - node.role == worker visualizer: image: dockersamples/visualizer ports: - "8080:8080" volumes: - "/var/run/docker.sock:/var/run/docker.sock" deploy: placement: constraints: - node.role == manager apache-php: image: apache-app ports: - "80:80" volumes: - /home/docker/apache-app/000-default.conf:/etc/apache2/sites-enabled/000-default.conf - /home/docker/apache-app/resources/my-viewer:/var/www/html deploy: placement: constraints: - node.role == manager
after stack deploy, there is no error message everthing seems to be working fine. Also
docker container ls or
docker service ls, i see all the container and services as expected.
Problem is, if i want to access visualizer with x.y.z.100:8080, i get cannot make connection. So I checked
sudo netstat -nlp | grep 8080
sudo netstat -nlp | grep 8090
sudo netstat -nlp | grep 80
and it does not show anything listening on these port, but if i run the same thing on x.y.z.101, i see 8090 is being used by my-app, as expected.
Also if run container using
docker run, things work fine.
Thanks in advance for any suggestion and help.