Cluster architecture
- Docker & Kubernetes course
- Intermediate
- Lesson 3/82
- 4 min
Learn the architecture of control plane and nodes.
Cluster architecture
A Kubernetes cluster consists of two kinds of machines:
- Control plane: the brain of the cluster. The API server, scheduler, controllers and the etcd database run here.
- Worker nodes: the machines where application pods actually run.
You and all the components talk to the cluster only through the API server.
$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
control-plane Ready control-plane 12d v1.31.2
worker-1 Ready <none> 12d v1.31.2
worker-2 Ready <none> 12d v1.31.2Where is a pod running?
The scheduler picks a suitable node for each pod. -o wide shows which node a pod runs on and with which IP:
$ kubectl get pods -o wide
NAME READY STATUS IP NODE
web-7c5b9f6d8-abcde 1/1 Running 10.244.1.5 worker-1
web-7c5b9f6d8-fghij 1/1 Running 10.244.2.7 worker-2In managed services (EKS, GKE, AKS), the provider runs the control plane; you only see the worker nodes.
Practice Look at the cluster
Write two commands: list the nodes in wide format (-o wide); then list the pods together with the nodes they run on.
Starter code
# buraya yazSample solution
kubectl get nodes -o wide
kubectl get pods -o wideExpected output
NAME STATUS ROLES VERSION INTERNAL-IP control-plane Ready control-plane v1.31.2 192.168.49.2 worker-1 Ready <none> v1.31.2 192.168.49.3 NAME READY STATUS IP NODE web-7c5b9f6d8-abcde 1/1 Running 10.244.1.5 worker-1
Questions and answers
Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.
1 Which component of the cluster do kubectl commands go to?
- Directly to etcd
- To the worker nodes
- To the Docker daemon
- kube-apiserver Correct answer
Explanation: The API server authenticates, validates the request and writes to etcd.
2 List the machines in the cluster.
kubectl get ____
kubectl get nodes
Explanation: Each machine is a node object.
3 Match.
| Term | Meaning |
|---|---|
control plane |
The cluster's brain |
worker node |
Runs pods |
kube-apiserver |
Single entry point |
-o wide |
Node and IP columns |