liveBook · Manning

Docker Swarm task

As explained in Road to Kubernetes

A Docker Swarm task is a scheduled unit representing a container instance in a Swarm service.

A Docker Swarm task is a running container scheduled by a manager node on a worker node. Once defined, a task stays on its assigned node. section 9.1

Understand a task through its place in Docker Swarm:

  • A manager node schedules tasks; a worker node runs them. section 9.1
  • A service defines the task to execute, while a stack groups services from a Docker Compose file. section 9.1
  • The docker stack ps command lists the tasks running in a named stack. section 9.1.4

Inspect tasks in a deployed stack

After deploying with docker stack deploy -c compose-swarm.yaml rk8s, run docker stack ps rk8s to see the containers running in the stack. To enter one, run docker exec on the node where its task is running. section 9.1.4

Figure 9.3 Docker Swarm Stack deployment output

View the deployment output associated with a Swarm stack and its running tasks. section 9.1.4

How Road to Kubernetes covers it

How deep it goes
Defines task terminology, scheduling, and node placement, then demonstrates inspection without detailing container internals.
Examples
Uses docker stack deploy, docker stack ps, docker ps, and docker exec with the rk8s stack.
What it assumes
Assumes Docker Compose configuration and a Swarm cluster with manager and worker nodes.
What you can do after
Operate/configure a Swarm deployment and inspect its tasks with Docker stack commands.
How it connects
Connects tasks with Docker Swarm services, stacks, manager nodes, worker nodes, and Kubernetes Pods.

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.