In Chapter 1 you typed lines and Pods appeared. This lesson is about the programs that made that happen.
Two halves
A cluster has a control plane and nodes. The control plane decides. The nodes run containers.
kube-apiserverthe only door in: kubectl, kubelets and controllers all talk to it
etcdthe database: every object in the cluster
kube-schedulerpicks a node for each new Pod
kube-controller-managerruns the controllers: ReplicaSet, Deployment, Job, ...
| Component | Job |
|---|---|
| API server | Receives every request, checks it, stores it. The only program that talks to etcd |
| etcd | Stores every object: Pods, namespaces, labels, everything |
| scheduler | Watches for Pods with no node and chooses one |
| controller manager | Runs the control loops that compare what should exist with what does, and fix the difference |
One request, end to end
API servervalidates and stores the Pod
etcdwrites it down
schedulerpicks a node
kubeleton the node, starts the container
You wrote one line. The rest happened without you. That is the model of the whole system: you say what should exist, and the control plane works until it does.
Where it lives
text
learner@shallows:~$ kubectl cluster-info
Kubernetes control plane is running at https://10.0.0.10:6443
CoreDNS is running at https://10.0.0.10:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxyThe API server listens on port 6443. The add-ons that the cluster needs for itself, such as CoreDNS (names, Chapter 4) and the metrics server (usage, Chapter 6), run as ordinary Pods in the namespace kube-system.