Skip to main content
RunBook Academy

Docker & ContainersXXXVII Β· Orchestration TransitionThe orchestration model

What an orchestrator actually does β€” the reconciliation loop

Advanced⏱ ~22 mindocker

What you'll learn

  • Describe the observe-diff-act loop that defines an orchestrator
  • Explain why imperative container commands stop working once one is running
  • Name the operational obligations an orchestrator adds to a host estate
  • Identify problems an orchestrator does not solve

Prerequisites

Verified against Docker Engine 29.x Β· Docker Engine 28.x Β· Docker Compose 2.x Β· containerd 2.x Β· runc 1.2.x Β· BuildKit 0.20+ Β· Linux kernel 5.15+ Β· Ubuntu 24.04 LTS Β· Debian 12 (Bookworm) Β· 2026-08-11

Not yet marked complete on this device.

The previous lesson listed the triggers for outgrowing single-host Compose. This one is about what you are actually adopting when you act on them β€” because the three orchestrators differ wildly in size and ecosystem, and are identical in the one mechanism that changes how you work.

That mechanism is a control loop. Everything operationally strange about orchestrators, and everything they cost, comes from it.

Imperative and declarative

The consequence people meet on day one is that imperative commands stop working. Kill a container that an orchestrator is managing and it comes back within seconds, on that node or another:

Service impact possiblefutile
$ docker rm -f myapp.3.qk8x1v2w9r7t
myapp.3.qk8x1v2w9r7t

$ docker ps --filter label=com.docker.swarm.service.name=myapp --format '{{.Names}}'
myapp.3.n4d7p1x8s2gv

Illustrative output

Same task, new container ID, four seconds later. This is not a bug and it is not something to fight. To stop a service you change the desired state β€” scale it to zero, or remove the service object β€” and the loop does the rest.

What the loop is good at

The loop is why an orchestrator can offer things a single host cannot:

  • Self-healing. A node dies, the controller observes that three of four replicas exist, and places the fourth somewhere else. No human involved.
  • Rolling updates. Changing the image in the desired state makes the diff non-zero for every replica; the controller works through them at whatever parallelism you configured, checking health as it goes.
  • Rescheduling. Draining a node for maintenance is a desired-state change (β€œno work on this node”), and the loop moves everything off it.
  • Convergence after partial failure. A deploy interrupted halfway leaves the desired state intact, so the loop finishes the job when the control plane comes back.

None of that is free.

What the loop costs

What an orchestrator does not do

It is worth being blunt, because this is where most disappointment comes from.

ProblemDoes an orchestrator solve it?
A node dies and stateless replicas must moveYes
Rolling out a new image without downtimeYes
Spreading work across hosts by resource fitYes
Making a single-writer database highly availableNo β€” that is the database’s replication and failover, not the scheduler’s
Data that must follow a container between nodesNo β€” you need shared or replicated storage, which is its own project
An application that cannot run two copies at onceNo β€” it makes it worse, because the loop wants to run two during an update
Sticky sessions held in local memoryNo
Deciding what β€œhealthy” meansNo β€” you still write the health check, and a wrong one causes rolling restarts of a working service

An orchestrator schedules processes. It does not make an application distributed, and pointing one at a stateful monolith usually produces a less reliable system than the single host it replaced, because there are now two things that can fail.

Knowledge check

Knowledge check Β· 4 questions

  1. Q1. What does an orchestrator do that a Docker restart policy does not?

  2. Q2. `docker service update` and `kubectl apply` return once the desired state has been accepted, which can be well before reality has converged to match it.

  3. Q3. Which new operational obligations does adopting an orchestrator create? Select all that apply.

  4. Q4. Four replicas are requested; three are running and the fourth never appears. Where do you look first?

Passing score: 75%. Answers are checked in this browser.