Inside the cluster: control plane and nodes

The parts of a cluster, found on your own machine.

Beginner20 min · lesson 2 of 21
Lesson files
The scripts, test data and local test servers this lesson uses, exactly as they ran on the lab machine (1 files, 1 KB): clustermap.tar.gz. The lab VM shares no folders with your computer, so fetch them inside the VM: cd ~/lab && curl -fsSLO https://secopslog.com/lab-files/k8s-fund/clustermap.tar.gz && tar -xzf clustermap.tar.gz, which creates ~/lab/clustermap/. SHA-256: 8317dc3268f4f7923db9d53b85234d492227aa117d3a588c4057adad0a522971

When you deleted a Pod in lesson 1, three separate programs were involved in getting it back. One noticed that a Pod was missing, another chose a node for the replacement, and a third, on that node, started the container. If one of them stops, the cluster still accepts your commands, but part of the work quietly stops. To find the broken part, you need to know which program does what.

All of those programs run on your kind cluster, and you can see each of them.

Two halves

The control plane stores what you asked for and decides what should happen. The nodes do the work: they run your containers. In kind the control plane lives on lab-control-plane, and the two workers run your apps.

One kind cluster
lab-control-plane
kube-apiserver
the only door in
etcd
stores every object
kube-scheduler
picks a node
kube-controller-manager
runs the controllers
every node
kubelet
starts Pods
containerd
runs containers
kube-proxy
Service rules
kindnet
Pod network
kubectl only ever talks to kube-apiserver. Every other component reads and writes cluster state through it too.

The cluster runs its own parts in the kube-system namespace, a separate area of the cluster (lesson 19, Namespaces). -n kube-system points kubectl there. -o custom-columns=... picks which columns to print, here the Pod name, its node and its phase:

ubuntu@secopslog-k8s:~/lab/clustermap · Kubernetes 1.37
$ kubectl get nodes
NAME STATUS ROLES AGE VERSION lab-control-plane Ready control-plane 95s v1.37.0 lab-worker Ready <none> 74s v1.37.0 lab-worker2 Ready <none> 74s v1.37.0
$ kubectl get pods -n kube-system -o custom-columns=NAME:.metadata.name,NODE:.spec.nodeName,STATUS:.status.phase
NAME NODE STATUS coredns-559f6c778d-rvtcs lab-control-plane Running coredns-559f6c778d-z6j4g lab-control-plane Running etcd-lab-control-plane lab-control-plane Running kindnet-5qvsq lab-control-plane Running kindnet-ffbn4 lab-worker Running kindnet-tjvz9 lab-worker2 Running kube-apiserver-lab-control-plane lab-control-plane Running kube-controller-manager-lab-control-plane lab-control-plane Running kube-proxy-2bqkb lab-worker Running kube-proxy-rqjjl lab-worker2 Running kube-proxy-vdxtj lab-control-plane Running kube-scheduler-lab-control-plane lab-control-plane Running

Four Pods carry the node name in their own name and run only on lab-control-plane: etcd, kube-apiserver, kube-controller-manager and kube-scheduler. Then there are kindnet and kube-proxy, with one Pod on each of the three nodes. The two coredns Pods also sit on the control-plane node in kind.

The control plane

kube-apiserver is the front door. kubectl sends every request there, and so does every other component. It checks who you are and whether the object is valid, then saves it. etcd is the database where it saves it, and nothing else reads etcd directly. kube-scheduler watches for Pods that have no node yet and picks one. kube-controller-manager runs the controllers: small loops that compare what exists with what was asked for and fix the difference. The Deployment that replaced your Pod in lesson 1 is handled by one of them.

No Deployment stands behind these four Pods, because the scheduler and controllers that would run one are among them. Instead, the kubelet on the control-plane node reads them from files. docker exec runs a command inside the node container, just as it does for any Docker container:

ubuntu@secopslog-k8s:~/lab/clustermap · Kubernetes 1.37
$ docker exec lab-control-plane ls /etc/kubernetes/manifests
etcd.yaml kube-apiserver.yaml kube-controller-manager.yaml kube-scheduler.yaml
$ kubectl get pod -n kube-system kube-scheduler-lab-control-plane -o jsonpath='{.metadata.annotations.kubernetes\.io/config\.source}{" "}{.metadata.ownerReferences[0].kind}{"\n"}'
file Node

Those four YAML files are static Pods. The kubelet starts whatever is in /etc/kubernetes/manifests by itself, without asking the scheduler, and then posts a read-only copy to the API server so you can see it with kubectl. The second command prints two fields of that copy with -o jsonpath (lesson 5, kubectl basics): its config source is file, and its owner is the Node, not a Deployment.

kubectl get --raw sends a plain request to an API server path. The /readyz path reports whether the API server is ready, check by check, including its link to etcd:

ubuntu@secopslog-k8s:~/lab/clustermap · Kubernetes 1.37
$ kubectl get --raw='/readyz?verbose'
[+]ping ok [+]log ok [+]etcd ok [+]etcd-readiness ok ... readyz check passed

The full list has 37 checks, cut here to the first four. [+]etcd ok is the API server's connection to etcd. Each [+] is a check that passed. A failing check shows [-], and the last line then says the check failed.

On every node

Not everything is a Pod. The kubelet is the agent on each node that starts and watches Pods, and containerd is the container runtime it asks to do the actual work. Both are plain system services inside the node:

ubuntu@secopslog-k8s:~/lab/clustermap · Kubernetes 1.37
$ docker exec lab-worker systemctl is-active kubelet containerd
active active
$ docker exec lab-worker systemctl status kubelet --no-pager --lines=0
● kubelet.service - kubelet: The Kubernetes Node Agent Loaded: loaded (/etc/systemd/system/kubelet.service; enabled; preset: enabled) Drop-In: /etc/systemd/system/kubelet.service.d └─10-kubeadm.conf, 11-kind.conf Active: active (running) since Wed 2026-11-11 04:25:55 UTC; 1min 22s ago Invocation: 7956972563fb423aa70b9c3966f7a598 Docs: http://kubernetes.io/docs/ Process: 233 ExecStartPre=/bin/sh -euc if [ -f /sys/fs/cgroup/cgroup.controllers ]; then /kind/bin/create-kubelet-cgroup-v2.sh; fi (code=exited, status=0/SUCCESS) Process: 241 ExecStartPre=/bin/sh -euc if [ ! -f /sys/fs/cgroup/cgroup.controllers ] && [ ! -d /sys/fs/cgroup/systemd/kubelet ]; then mkdir -p /sys/fs/cgroup/systemd/kubelet; fi (code=exited, status=0/SUCCESS) Main PID: 243 (kubelet) Tasks: 13 (limit: 948) Memory: 31.5M (peak: 31.8M) CPU: 6.903s CGroup: /kubelet.slice/kubelet.service └─243 /usr/bin/kubelet --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf --config=/var/lib/kubelet/config.yaml --node-ip=172.18.0.3 --provider-id=kind://docker/lab/lab-worker --node-labels= --runtime-cgroups=/system.slice/containerd.service

Both services report active. The status output shows the kubelet's command line: it reads its settings from /var/lib/kubelet/config.yaml and its credentials from /etc/kubernetes/kubelet.conf. crictl is a small client for containerd, much like docker ps for a Kubernetes node:

ubuntu@secopslog-k8s:~/lab/clustermap · Kubernetes 1.37
$ docker exec lab-worker crictl ps
CONTAINER IMAGE CREATED STATE NAME ATTEMPT POD ID POD NAMESPACE 0909163bc8fce 8e13ccc0aaa68 54 seconds ago Running kindnet-cni 0 042397306bc34 kindnet-ffbn4 kube-system 13538339a83fb 550b682d81d41 59 seconds ago Running kube-proxy 0 f1d15a3a02078 kube-proxy-2bqkb kube-system

Only two containers run on this worker: kindnet-cni and kube-proxy, both from the kube-system namespace. They come from DaemonSets, which run one Pod on every node:

ubuntu@secopslog-k8s:~/lab/clustermap · Kubernetes 1.37
$ kubectl get daemonsets -n kube-system
NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE kindnet 3 3 3 3 3 kubernetes.io/os=linux 89s kube-proxy 3 3 3 3 3 kubernetes.io/os=linux 93s
$ kubectl get deployment coredns -n kube-system
NAME READY UP-TO-DATE AVAILABLE AGE coredns 2/2 2 2 94s

DESIRED is 3 for both, one per node. kube-proxy turns Services (lesson 8, Services) into network rules on each node. kindnet is kind's network plugin: it gives each Pod an IP address and lets Pods on different nodes reach each other. CoreDNS is an ordinary Deployment with two replicas that answers DNS names inside the cluster (lesson 15, DNS).

Stop the scheduler

Move the scheduler's file out of the manifests folder, and the kubelet stops that static Pod. kubectl wait --for=delete returns once the Pod is gone, and kubectl run creates a single Pod from an image without a YAML file. Then kubectl wait --for=condition=PodScheduled waits up to 30 seconds for the new Pod to get a node:

ubuntu@secopslog-k8s:~/lab/clustermap · Kubernetes 1.37
$ docker exec lab-control-plane mv /etc/kubernetes/manifests/kube-scheduler.yaml /root/
$ kubectl wait --for=delete pod/kube-scheduler-lab-control-plane -n kube-system --timeout=120s
pod/kube-scheduler-lab-control-plane condition met
$ kubectl run pending --image=nginx:1.30.6-alpine
pod/pending created
$ kubectl wait --for=condition=PodScheduled pod/pending --timeout=30s
error: timed out waiting for the condition on pods/pending
$ kubectl get pod pending -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES pending 0/1 Pending 0 31s <none> <none> <none> <none>
$ kubectl events --for pod/pending
No events found in default namespace.

The API server accepted the Pod (pod/pending created), because storing objects is its job. Nothing assigned it a node, so the wait timed out. -o wide adds the NODE column, and it still says <none>. kubectl events lists a Pod's events, the history the cluster records about it, and there are none. The scheduler is the part that would have written Scheduled, or a reason why it could not. A Pod stuck in Pending with no events at all points at the scheduler.

Put the file back:

ubuntu@secopslog-k8s:~/lab/clustermap · Kubernetes 1.37
$ docker exec lab-control-plane mv /root/kube-scheduler.yaml /etc/kubernetes/manifests/
$ kubectl wait --for=condition=Ready pod/pending --timeout=180s && kubectl get pod pending -o wide
pod/pending condition met NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES pending 1/1 Running 0 36s 10.244.2.2 lab-worker <none> <none>
$ kubectl events --for pod/pending
LAST SEEN TYPE REASON OBJECT MESSAGE 2s Normal Scheduled Pod/pending Successfully assigned default/pending to lab-worker 1s Normal Pulled Pod/pending Container image "nginx:1.30.6-alpine" already present on machine and can be accessed by the pod 1s Normal Created Pod/pending Container created 1s Normal Started Pod/pending Container started
$ kubectl delete pod pending
pod "pending" deleted from default namespace

Within seconds the restarted scheduler found the waiting Pod and placed it on a worker. The ages tell the story: the Pod is 36 seconds old, but its Scheduled event is only 2 seconds old. The image event says already present on machine because nginx was already on the node. With a fresh image you would see Pulling here instead.

Hands-on

Take away the controller manager instead, and see which part of a Deployment still appears.

1. Stop it: docker exec lab-control-plane mv /etc/kubernetes/manifests/kube-controller-manager.yaml /root/

2. Wait until its Pod is gone: kubectl wait --for=delete pod/kube-controller-manager-lab-control-plane -n kube-system --timeout=120s

3. Create a Deployment: kubectl create deployment web --image=nginx:1.30.6-alpine --replicas=2

4. Give it 30 seconds: kubectl rollout status deployment/web --timeout=30s

5. List what exists: kubectl get deployments,replicasets,pods

6. Start it again and wait for the rollout: docker exec lab-control-plane mv /root/kube-controller-manager.yaml /etc/kubernetes/manifests/ && kubectl rollout status deployment/web --timeout=180s

7. List again: kubectl get deployments,replicasets,pods

8. Clean up: kubectl delete deployment web

What you should see: step 2 prints condition met. Step 4 prints Waiting for deployment spec update to be observed... and then times out. Step 5 lists only deployment.apps/web at 0/2, with no ReplicaSet and no Pods, because creating those is a controller's job. Step 6 ends with successfully rolled out, and step 7 shows a ReplicaSet a few seconds old that owns two new Pods. The Deployment is more than a minute older than both, which shows how long it waited.

Remember

Everything goes through kube-apiserver, which keeps its state in etcd. The scheduler picks nodes, the controllers act on what you asked for, and on each node the kubelet has containerd run the containers. When something is stuck, ask which of these should have acted next.

Quick check
01A new Pod stays Pending with <none> in the NODE column and no events at all. Which part is most likely down?
Incorrect — If etcd were down, the API server could not store the Pod, and kubectl run would have failed.
Correct — With the scheduler stopped, the lab Pod sat Pending with no node and no events.
Incorrect — No worker had been chosen yet. Picking one is the scheduler's job, before any kubelet acts.
Incorrect — kube-proxy handles Service rules. It plays no part in choosing a node.
02Why do kube-apiserver and kube-scheduler run as static Pods instead of from a Deployment?
Incorrect — A static Pod runs the same containers in the same way. Speed has nothing to do with it.
Incorrect — CoreDNS is a Deployment in kube-system.
Incorrect — Static Pods skip the scheduler entirely. The kubelet starts them itself.
Correct — The kubelet starts them from files in /etc/kubernetes/manifests, so no controller or scheduler is needed.
03You stop kube-controller-manager and create a Deployment with two replicas. What does kubectl get deployments,replicasets,pods show?
Correct — The API server stored the Deployment, but no controller acted on it. That is what the hands-on printed.
Incorrect — Creating the ReplicaSet is itself a controller's job, so there was none.
Incorrect — kubectl create deployment succeeded. The API server does not need the controllers to store objects.
Incorrect — The kubelet only runs Pods bound to its node, and no Pod object was ever created.

Related