TwiceToldby Develoker
ConceptsSystem designLabsCheat sheetsAbout

Develoker makes free tools for learning to build software. TwiceTold explains each idea twice, as an everyday analogy and the real thing; CloudArch lets you design cloud systems and put load on them.

About ยท Labs ยท Cheat sheets ยท Learning paths

โ† Back to Kubernetes

โš“ Kubernetes: cheat sheet

๐ŸŽจ The analogyA harbour master who keeps the right number of ships docked and replaces any that sink.
๐ŸŽ“ The regular explanationA container orchestrator. You declare the desired state (which images, how many copies, how to reach them) and controllers keep the cluster matching it by scheduling, restarting, scaling and rolling out updates.
The harbour master's listStep 2 of 2
๐Ÿง‘โ€โœˆ๏ธShip ownerโš“Harbour master3 of 3๐ŸšขShip 1๐ŸšขShip 2๐ŸšขShip 3
  1. You don't dock ships yourself. You give the harbour master a note saying "I want 3 of these ships docked at all times".
  2. The harbour master sees none docked, and calls in three.
A ship sinksStep 3 of 3
โš“Harbour master3 of 3๐ŸšขShip 1๐ŸšขShip 3๐Ÿ›ณ๏ธReplacement ship
  1. The harbour master keeps checking. Every ship reports in.
  2. Ship 2 springs a leak and sinks. Only two are docked now.
  3. Nobody has to phone you. The harbour master spots the gap and calls in a replacement.
Swapping the fleet, one ship at a timeStep 3 of 3
๐ŸšชHarbour gate๐Ÿ›ณ๏ธNew ship Aready๐Ÿ›ณ๏ธNew ship B
  1. Cargo comes through the harbour gate and goes to whichever ships are ready.
  2. You ask for newer ships. One new ship docks, and only once it's ready does it start taking cargo.
  3. Then one old ship leaves. Repeat until the fleet is all new. The harbour never closed.

๐Ÿงฉ Key questions

What does your note to the harbour master say?
What you want: three of these ships docked at all times. The harbour master works out how to get there, choosing berths with room.
A ship sinks. What happens?
The gap is spotted and a replacement is called in. The note still says three, so there will be three.
How is the fleet upgraded without closing the harbour gate?
One new ship docks and takes cargo once ready, then one old ship leaves, and repeat. The gate never closes, because there are always ready ships.