โ 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.
- You don't dock ships yourself. You give the harbour master a note saying "I want 3 of these ships docked at all times".
- The harbour master sees none docked, and calls in three.
- The harbour master keeps checking. Every ship reports in.
- Ship 2 springs a leak and sinks. Only two are docked now.
- Nobody has to phone you. The harbour master spots the gap and calls in a replacement.
- Cargo comes through the harbour gate and goes to whichever ships are ready.
- You ask for newer ships. One new ship docks, and only once it's ready does it start taking cargo.
- 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.