Scheduling, placement and resource reservations
Worked example
This is an offline lesson. Data are fictional and Docker commands are unexecuted. Any optional execution requires an authorized disposable VM, a verified context, synthetic data, restricted access and no external transmission. Do not collect secrets or private output. Use only the fictional worksheet for this exercise. Before a separately authorized read-only server query, verify the effective endpoint including environment overrides, project or cluster identity, and access scope. Never deploy the fragments, use real credentials or transmit private inspection output.
Fictional placement inventory (MiB of free reservable memory):w1: active, zone=a, 1024w2: active, zone=b, 512w3: drain, zone=b, 4096w4: active, zone=a, 256Task reservation: 512 MiB; desired: 4Constraint: eligible worker nodes onlyCapacity upper bound: 2 + 1 + 0 + 0 = 3 tasksAt least one task cannot fit under these assumptions.An Active node accepts new tasks; a Drain node does not accept service tasks and existing service tasks are moved through replacement when feasible. Draining does not remove standalone containers. A Pause node keeps existing tasks but receives no new tasks. In the example only memory and availability are modeled, so real capacity may be lower due to CPU, labels, image platform, existing reservations or per-node replica limits. A preference for spreading across a zone label is not a hard anti-affinity guarantee. Set constraints for genuine requirements, reserve capacity for updates and failures, and use independent health checks. Do not lower reservations just to hide a pending state without evidence of safe demand. Three slots are an upper bound under the worksheet assumptions, not a scheduler guarantee. Reservations describe schedulable capacity, not live free RAM or hard memory limits. Paused and drained nodes cannot accept new tasks; existing task behavior differs between pause and drain.
Common mistake
A large drained node is not spare scheduling capacity until its availability and other requirements are deliberately reviewed.
Manual practice
Change w2 to 1024 MiB and the desired count to five. Compute the memory-only upper bound. Then explain how a mandatory zone=b constraint and a one-task-per-node limit affect it.
Worksheet: lab-fixtures/docker-swarm-orchestration/03-placement/scenario.txt.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Scheduling, placement and resource reservations — Knowledge check
Interpret cluster orchestration evidence and make a safe operational decision.
What is the memory-only capacity upper bound in the original example?
Does a spread preference guarantee strict separation?
What does Drain do to standalone containers?