Docker Swarm Drain Node "Problem"


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?


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…

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.

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

I opened an issue for this a while ago: