Free to read · CKA · Cluster architecture and kubectl fluency
Demo: a guided tour of a kubeadm cluster
How the control plane and the nodes of a kubeadm cluster work together, how the API is organised, and the kubectl and exam habits that make every later module faster.
Demo · 15 min. This module is free on this site. The rest of the course, the quizzes and the labs open with a free account.
What you will do
You will walk around a two-node kubeadm cluster (controlplane and node01) and find every component from the previous lessons with your own eyes: the static pods, the kubelet, the runtime, the CNI and etcd. Run the commands on a lab cluster as you read. Your names, IPs, versions and IDs will differ; the shape of the output will not.
Start a lab such as C12 to get a cluster, then work on controlplane as root.
Step 1: the nodes
kubectl get nodes -o wide
NAME STATUS ROLES AGE VERSION INTERNAL-IP OS-IMAGE CONTAINER-RUNTIME
controlplane Ready control-plane 42m v1.37.1 10.0.0.10 Ubuntu 24.04.3 LTS containerd://2.1.4
node01 Ready <none> 39m v1.37.1 10.0.0.11 Ubuntu 24.04.3 LTS containerd://2.1.4
The CONTAINER-RUNTIME column already tells you the CRI implementation. The control plane node carries a taint that keeps normal pods away:
kubectl describe node controlplane | grep -A1 Taints
Taints: node-role.kubernetes.io/control-plane:NoSchedule
Unschedulable: false
Step 2: the system pods
kubectl get pods -n kube-system -o wide
NAME READY STATUS RESTARTS AGE IP NODE
calico-kube-controllers-6c8d5f9b7-qk2lp 1/1 Running 0 41m 192.168.49.1 controlplane
calico-node-7xgkd 1/1 Running 0 39m 10.0.0.11 node01
calico-node-fz9wm 1/1 Running 0 41m 10.0.0.10 controlplane
coredns-5d78c9869d-8vdrn 1/1 Running 0 42m 192.168.49.2 controlplane
coredns-5d78c9869d-wl4sp 1/1 Running 0 42m 192.168.49.3 controlplane
etcd-controlplane 1/1 Running 0 42m 10.0.0.10 controlplane
kube-apiserver-controlplane 1/1 Running 0 42m 10.0.0.10 controlplane
kube-controller-manager-controlplane 1/1 Running 0 42m 10.0.0.10 controlplane
kube-proxy-hn6tq 1/1 Running 0 39m 10.0.0.11 node01
kube-proxy-p2w8c 1/1 Running 0 42m 10.0.0.10 controlplane
kube-scheduler-controlplane 1/1 Running 0 42m 10.0.0.10 controlplane
Read the names. Pods ending in -controlplane are mirror pods of static pods. Pods with random suffixes belong to Deployments (coredns, calico-kube-controllers) or DaemonSets (calico-node, kube-proxy, one per node). Pods that use the node's IP run with hostNetwork: true.
Confirm who owns what:
kubectl -n kube-system get pod kube-apiserver-controlplane -o jsonpath='{.metadata.ownerReferences[0].kind}{"\n"}'
kubectl -n kube-system get pod kube-proxy-hn6tq -o jsonpath='{.metadata.ownerReferences[0].kind}{"\n"}'
Node
DaemonSet
A mirror pod is owned by the Node. That is the giveaway for a static pod.
Step 3: the static pod manifests
ls /etc/kubernetes/manifests
grep staticPodPath /var/lib/kubelet/config.yaml
etcd.yaml kube-apiserver.yaml kube-controller-manager.yaml kube-scheduler.yaml
staticPodPath: /etc/kubernetes/manifests
Pull out the most useful API server flags:
grep -E -- '--(etcd-servers|service-cluster-ip-range|authorization-mode|enable-admission-plugins)' \
/etc/kubernetes/manifests/kube-apiserver.yaml
- --authorization-mode=Node,RBAC
- --enable-admission-plugins=NodeRestriction
- --etcd-servers=https://127.0.0.1:2379
- --service-cluster-ip-range=10.96.0.0/12
--etcd-servers pointing at 127.0.0.1 tells you etcd runs on this same node: a stacked topology. An external etcd would show other hosts here, and there would be no etcd.yaml.
Step 4: the kubelet
systemctl is-active kubelet; systemctl is-enabled kubelet
ps -o args= -C kubelet | tr ' ' '\n' | grep -- '--'
active
enabled
--bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf
--kubeconfig=/etc/kubernetes/kubelet.conf
--config=/var/lib/kubelet/config.yaml
Your flag list may be shorter or longer; kubeadm moves settings between flags and the config file over time. The --config file holds the rest:
grep -E 'cgroupDriver|containerRuntimeEndpoint|clusterDNS' -A1 /var/lib/kubelet/config.yaml
cgroupDriver: systemd
clusterDNS:
- 10.96.0.10
containerRuntimeEndpoint: unix:///run/containerd/containerd.sock
Step 5: the runtime
crictl version
crictl ps --name kube-apiserver
Version: 0.1.0
RuntimeName: containerd
RuntimeVersion: v2.1.4
RuntimeApiVersion: v1
CONTAINER IMAGE CREATED STATE NAME ATTEMPT POD ID POD
3f1b9e0c7d2a1 a4b2c8d9e1f00 42 minutes ago Running kube-apiserver 0 9c0d2e7f1a3b4 kube-apiserver-controlplane
This is the same API server you saw in kubectl, seen from below. If the API server ever stops answering, this is where you look.
Step 6: the pod network
ls /etc/cni/net.d
kubectl get nodes -o custom-columns=NAME:.metadata.name,PODCIDR:.spec.podCIDR
10-calico.conflist calico-kubeconfig
NAME PODCIDR
controlplane 192.168.0.0/24
node01 192.168.1.0/24
The first config file in sort order is the one the runtime loads. Calico assigns pod IPs from its own IP pools inside the cluster's pod CIDR, so pod IPs you see may not fall inside the node's podCIDR slice. That is normal for Calico; other plugins use the slice directly.
Step 7: etcd membership
export ETCDCTL_API=3
alias e='etcdctl --endpoints=https://127.0.0.1:2379 --cacert=/etc/kubernetes/pki/etcd/ca.crt \
--cert=/etc/kubernetes/pki/etcd/server.crt --key=/etc/kubernetes/pki/etcd/server.key'
e member list -w table
e endpoint status -w table
+------------------+---------+--------------+------------------------+------------------------+------------+
| ID | STATUS | NAME | PEER ADDRS | CLIENT ADDRS | IS LEARNER |
+------------------+---------+--------------+------------------------+------------------------+------------+
| 8e9e05c52164694d | started | controlplane | https://10.0.0.10:2380 | https://10.0.0.10:2379 | false |
+------------------+---------+--------------+------------------------+------------------------+------------+
+------------------------+------------------+---------+---------+-----------+-----------+------------+
| ENDPOINT | ID | VERSION | DB SIZE | IS LEADER | RAFT TERM | RAFT INDEX |
+------------------------+------------------+---------+---------+-----------+-----------+------------+
| https://127.0.0.1:2379 | 8e9e05c52164694d | 3.7.3 | 5.2 MB | true | 2 | 8131 |
+------------------------+------------------+---------+---------+-----------+-----------+------------+
(Output trimmed to the most useful columns; your etcd version follows your Kubernetes version.) One member, and it is the leader. In an HA cluster you would see three or five rows, each with its own peer URL, and exactly one leader.
Step 8: put it together
You have now located every piece:
| Piece | Where you found it |
|---|---|
| Control plane | Static pods from /etc/kubernetes/manifests, owned by the Node |
| etcd topology | --etcd-servers and etcd.yaml: stacked |
| kubelet | systemd, /var/lib/kubelet/config.yaml |
| CRI | containerd via unix:///run/containerd/containerd.sock |
| CNI | Calico, /etc/cni/net.d/10-calico.conflist |
| Service CIDR | --service-cluster-ip-range on the API server |
Common mistakes
- Running
etcdctlwithout the certificates. It hangs, then fails with a context deadline error. - Reading
/etc/cni/net.don one node and assuming the other node matches. Check the node the task names. - Trusting the example values in this demo. Always read your own cluster.
Practise it
Write your findings up as reports, exactly as an exam task would ask:
Practise this on a real cluster in your account: C12, C36:a, C28:a.