Home > Software engineering >  Does a drained Docker Swarm Manager Node still participate the routing mesh (ingress network)?
Does a drained Docker Swarm Manager Node still participate the routing mesh (ingress network)?

Time:04-08

Just wondered if a drained manager node still participate in the described routing mesh.

Let's assume the node3 is drained. Would the service my-web.1 still be accessible via HAProxy -> node3 -> my-web.1?

CodePudding user response:

When a node is drained, all existing tasks run on it are stopped and are run on ACTIVE nodes. Also, the drained node won't be able to receive new tasks from the swarm manager.

However, the drained node still participates in the routing mesh and your service my-web.1 would still be accessible from node3. Ref: https://docs.docker.com/engine/swarm/swarm-tutorial/drain-node/

Here is what I have done to confirm that behaviour:

  1. Created a service with 3 replicas for a simple flask app. I am running two nodes here.
  2. The tasks are distributed on the two nodes. I can access my flask app from the IP address of both nodes.
  3. I have set the availability of one of the nodes to DRAIN, and all the flask app tasks in it are stopped and created on the other active node.
  4. I can still access the flask app from the IP address of the drain node. Also, the logs of the service show the requests coming from the IP address of the drained node.
  • Related