Control plane
- Docker & Kubernetes course
- Intermediate
- Lesson 4/82
- 4 min
Learn the control plane components.
The control plane
The four main components of the control plane:
- kube-apiserver: the REST API; all reads/writes go through it.
- etcd: the distributed key-value database holding the cluster state.
- kube-scheduler: picks a node for new pods.
- kube-controller-manager: runs controller loops that move the actual state toward the desired state.
$ kubectl get pods -n kube-system
NAME READY STATUS
etcd-control-plane 1/1 Running
kube-apiserver-control-plane 1/1 Running
kube-controller-manager-control-plane 1/1 Running
kube-scheduler-control-plane 1/1 RunningComponent health
The API server has its own health endpoints. They can be read directly with kubectl get --raw; kubectl cluster-info shows the API address:
$ kubectl cluster-info
Kubernetes control plane is running at https://192.168.49.2:8443
CoreDNS is running at https://192.168.49.2:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
$ kubectl get --raw='/readyz?verbose' | tail -2
[+]etcd ok
readyz check passedPractice Inspect the control plane
Write two commands: show the cluster information; list the pods in the kube-system namespace.
Starter code
# buraya yazSample solution
kubectl cluster-info
kubectl get pods -n kube-systemExpected output
Kubernetes control plane is running at https://192.168.49.2:8443 NAME READY STATUS RESTARTS AGE etcd-minikube 1/1 Running 0 2d kube-apiserver-minikube 1/1 Running 0 2d
Questions and answers
Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.
1 Where is the whole state of the cluster stored?
- On the worker nodes' disks
- In the kubectl configuration
- etcd Correct answer
- kube-scheduler
Explanation: If etcd is lost, the cluster's definition is lost too; that's why it's backed up.
2 List the pods of the system components.
kubectl get pods -n ____
kubectl get pods -n kube-system
Explanation: System components are in the kube-system namespace.
3 Match the components.
| Term | Meaning |
|---|---|
kube-apiserver |
REST API |
etcd |
State database |
kube-scheduler |
Node selection |
controller-manager |
Controller loops |