Docker Community Forums

Share and learn in the Docker community.

Docker Swarm Drain Node "Problem"

swarm
docker

(Rodrigozc) #1

Hi,

I’m using docker swarm with 2 nodes, a manager and a worker.

When I drain the worker, the containers don’t migrate to manager.

Is this the right behavior?

Is there a way to auto scale containers to the right number on manager without manually scale down and scale up?

Thanks!!!


(Markvr) #2

Do you have any constraints set, e.g. "node.role != manager" ?

What do you mean “auto scale”? When draining a node, docker will stop the containers on that node, and start them elsewhere, until the correct number of replicas is running. It would be more useful if it started them first, and then stopped them…


(Rodrigozc) #3

I haven’t any constraint like that.

I mean that containers in a drained node should start on another node to keep the correct number replicas before drain operation.


(Markvr) #4

Ah that isn’t possible and I would like it as well.

I opened an issue for this a while ago: https://github.com/moby/moby/issues/34139