Summary - Internals
- Docker & Kubernetes course
- Expert
- Lesson 6/47
- 5 min
Combine etcd, scheduler and controller to explain the architecture.
Summary: internals
In this group:
- etcd stores all state consistently with Raft; an odd number of members (3, 5) is used for quorum; keys are
/registry/.... - kube-scheduler filters and scores; affinity, anti-affinity and topology spread steer placement.
- kube-controller-manager runs dozens of controllers; in HA the leader is chosen with a Lease.
- kube-apiserver: authentication → RBAC → admission (mutating/validating) → validation → etcd.
- All controllers are level-triggered reconcile loops: read the spec, observe the world, close the gap, write the status.
kubectl get --raw /readyz?verbose
kubectl get lease -n kube-systemPractice Spread across zones
Write a pod template's topologySpreadConstraints section (starting with topologySpreadConstraints:): maxSkew: 1, topologyKey: topology.kubernetes.io/zone, whenUnsatisfiable: DoNotSchedule, labelSelector.matchLabels app: api.
Starter code
# buraya yazSample solution
topologySpreadConstraints:
- maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app: apiExpected output
deployment.apps/api configured
Questions and answers
Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.
1 What is the order of a pod creation request?
- kubelet → scheduler → etcd
- scheduler → apiserver → kubelet → etcd
- etcd → kubelet → apiserver
- apiserver → etcd → the scheduler picks a node → the kubelet starts it Correct answer
Explanation: Each component only talks to the API server.
2 Query the API server's readiness endpoint.
kubectl get --raw '/____?verbose'
kubectl get --raw '/readyz?verbose'
Explanation: /readyz and /livez are the API server's health endpoints.
3 Match.
| Term | Meaning |
|---|---|
etcd |
State |
scheduler |
Placement |
controller-manager |
Reconciliation |
apiserver |
Entry gate |