liveBook · Manning

Docker Swarm worker node

As explained in Road to Kubernetes

A Docker Swarm worker node is a Swarm node that runs the tasks assigned by a manager node.

A Docker Swarm worker node is a virtual machine that runs tasks—Swarm’s name for running containers—assigned by a manager node. A worker cannot run without a manager, and tasks stay on their assigned nodes once defined. section 9.1

Worker nodes execute commands issued through the manager. A practical cluster uses one manager and two workers, with changes made on the manager rather than directly on the workers. section 9.1.1

Add a worker node to a Swarm cluster:

  • Create a virtual machine in the same region as the manager, with a private IP address. section 9.1.3
  • Install Docker Engine, then run the manager-provided docker swarm join command with its worker token and private address. section 9.1.3
  • Repeat the process for each additional worker; successful output states that the node joined the swarm as a worker. section 9.1.3

A three-node application cluster

A manager coordinates two worker virtual machines. A Swarm stack defined with a Compose file deploys an NGINX load balancer, a Python web service, and a Node.js API service across the cluster. The workers run the container tasks while the manager controls deployment. section 9.1.1 section 9.1.3

Figure 9.2 Docker Swarm initialization output

Inspect the Swarm initialization output to see the join command and token that enroll worker nodes. section 9.1.3

How Road to Kubernetes covers it

How deep it goes
Explains worker roles, fixed task placement, private networking, Docker installation, and token-based joining without deeper scheduling internals.
Examples
Uses two worker virtual machines running NGINX, a Python web service, and a Node.js API in a three-node cluster.
What it assumes
Assumes access to virtual machines and SSH, while teaching Docker installation and Swarm worker enrollment step by step.
What you can do after
Operate/configure a worker by installing Docker and joining it to a manager-controlled Swarm with a private address and token.
How it connects
Connects worker nodes with Docker Swarm managers, tasks, services, stacks, Docker Compose, and Kubernetes nodes.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Road to Kubernetes. The section links point to the parts of the book it draws on.