Lesson 1 · Unit 01
Why an orchestrator
Desired state, actual state, and the loop that closes the gap.
What you practise
- Nodes and the control plane, desired against actual state, the reconciliation loop, what happens when a node dies
Try a question from this lesson
Pick one
You start three copies of a web server by hand, one on each of three machines. At 3 a.m. one machine loses power. What happens to the copy that ran on it?
Hint
Ask who, at 3 a.m., knows that there were supposed to be three.
Correct answer
It stays gone until a person starts it again
Why
Nobody told any machine that three copies should exist: you ran three commands, once. A command is finished when it returns. Keeping three alive needs something that remembers the number and keeps checking it.
The ideas
Concept cards are short on purpose. In the app they appear between questions, after you have met the idea.
Concept
Declare it, then let a loop keep it
Kubernetes is an orchestrator: it runs containers across many machines, called nodes.
You do not tell it what to do. You tell it what should exist: the desired state. A controller is a loop that compares that with the actual state and acts on the difference, again and again, like a thermostat holding a temperature.
This is called reconciliation, and it never finishes.
desired: 3 copies actual: 2 copies
\ /
compare, then act
start 1 more copy
... and compare againConcept
Who does what in a cluster
A cluster has two kinds of machine.
The control plane decides. Its API server is the only door: every read and write goes through it, and it keeps all state in a store called etcd. The scheduler picks a node for each new Pod (a Pod is a group of containers, coming next). Controllers run the loops.
The nodes do the work. On each one an agent, the kubelet, starts and watches the containers assigned to it.
control plane each node
API server <----- kubelet
etcd container runtime
scheduler your containers
controllers8 more exercises in the app
- 3× multiple choice
- 1× match the pairs
- 2× true or false
- 1× order the lines
- 1× type the answer
Bitpath is an iOS app in development. Join the waitlist and you get one email when it is ready to try.