Skip to content

From Compose to Swarm to Kubernetes

Select an icon to see what it is.

Step 3 of 6

Swarm keeps desired and actual state equal

The manager places three tasks on nodes, and each node's dockerd starts a container for its task. If a container or a whole node dies, the manager sees fewer than three running tasks and starts a new one elsewhere. You declare what you want, and the cluster keeps reconciling.

$ docker service ps api

Reconciliation loop

desired: 3 running tasks
actual: 2 running tasks (a node failed)
action: schedule 1 new task on a healthy node