I run a service in swarm mode. I have one manager and two worker nodes and the service has 6 replicas divided on the three nodes. I can reach my service with manager:8080
, worker1:8080
, worker2:8080
without any problem.
Now, when I drain or shutdown worker2, worker2:8080
still works, that's what I expected. However, when I drain the manager ... manager:8080
is not reachable anymore. Why could this be?
I wanted to use swarm as a load balancer with high availability.
My manager has a domain so when I open domain:8080
and the container on the manager are down due whatever reason it should redirect to one of the workers as I understand it. Is this even possible? Or do I have to assign the domain to the workers?
edit:
i start the service with:
docker stack deploy -c docker-compose.yml --with-registry-auth <service_name>
my compose file:
version: "3.5"
services:
portal:
image: image-from-gitlab-registry:latest
ports:
- '80:80'
- '443:443'
deploy:
replicas: 6
networks:
- network
restart: always
redis:
image: redis:6.0.1
deploy:
replicas: 3
networks:
- network
ports:
- "6379:6379"
restart: always
environment:
- ALLOW_EMPTY_PASSWORD=yes
networks:
network: