Only Swarm manager nodes can orchestrate the cluster. You can elevate a worker node to manager or revert a manager back to a worker. Run these commands on any current manager.
Before patching or upgrading, remove workloads from a node to avoid downtime. The following diagram shows a Swarm cluster with one manager and two workers running a “Web” service.
Drain worker1 to migrate its tasks:
Copy
Ask AI
docker node update --availability drain worker1
Draining a node stops new tasks from being scheduled and reschedules existing ones on other workers. Ensure your cluster has enough capacity before draining.