Docker Swarm safely remove node in global mode

105 views Asked by At

Current status:

I got swarm up and running with 1 master and 2 worker nodes running in global mode, where each node serves an nginx server. The service is required to run in global mode.

Goal:

Now I want to scale down the whole swarm to 1 master node and 1 worker node without losing any requests. Meaning to safely remove 1 worker node.

Plan:

My current plan is to put 1 worker node into drain availability to safely (?) remove it from the swarm. But as stated in this answer drained nodes still participate in the routing mesh.

The docker documentation says, that

DRAIN availability prevents a node from receiving new tasks from the swarm manager. It also means the manager stops tasks running on the node and launches replica tasks on a node with ACTIVE availability.

Setting a node to DRAIN does not remove standalone containers from that node, such as those created with docker run, docker compose up, or the Docker Engine API. A node's status, including DRAIN, only affects the node's ability to schedule swarm service workloads.

Question:

Does the routing mesh still route new requests to the drained node? In this case they would time out when I remove the drained node from the swarm. If it does not, but keeps the container running - perfect! Old requests would then be answered.

Im a bit confused about the words workload and tasks in the documentation. Does it include routing new requests to the node?

0

There are 0 answers