Knowledge
Kubernetes: concepts and the lab cluster model
Estimated time: 55 minutes.
Machines in this article
| Machine | Role | Address |
|---|---|---|
cp-1 |
Control plane | 192.0.2.11 |
worker-1 |
Worker | 192.0.2.12 |
worker-2 |
Worker | 192.0.2.13 |
log-1 |
Log collector, outside the cluster | 192.0.2.14 |
The addresses in this article are illustrative addresses from the range reserved for documentation (RFC 5737); when you follow along, replace them with your own machines' addresses. 192.0.2.0/24 is the management range (NIC ens160, which holds the default route). Each machine also has two NICs on two secondary ranges, 198.51.100.0/24 (ens224) and 203.0.113.0/24 (ens192), keeping the same last octet .11–.14 across all three ranges.
Quick summary
-
Desired state (declarative)
- Why: Every resource is an object with a
spec(the desired state, declared by the user) and astatus(the actual state, written by the system) (Kubernetes: objects). The operator declares the outcome to reach, not the sequence of steps to get there. Every declaration goes through kube-apiserver and is then persisted, so it exists independently of your session: closing the terminal does not lose the declared intent. Consequence: a YAML file can go into Git and be applied repeatedly with the same result, unlike running a sequence of commands whose result depends on the machine's state at the time. - When it breaks: Understanding it as a "run-once command" leads to hand-editing directly on the node; the control loop will revert that change, and the person who edited wrongly concludes "Kubernetes overwrites things at random".
- In real deployments: Every change goes through files in Git, never hand edits on the cluster — that way both the change history and the way to roll back live in the repo.
- Why: Every resource is an object with a
-
The control loop (controller)
- Why: A controller is a process that watches one kind of resource, compares the observed state with the desired state, then acts to close the gap; this loop runs continuously (Kubernetes: controllers). kube-controller-manager bundles many controllers in one process: Deployment/ReplicaSet, node lifecycle, endpoint, service account. Each controller only reads and writes through the apiserver and never calls down to a node directly. Consequence: self-healing is not a separate feature but a consequence of the loop. A deleted Pod, a node that lost contact, an edited replica count — all of them are "drift" and all are handled by the same mechanism.
- When it breaks: Without seeing the loop, every "Pod comes back by itself" phenomenon becomes hard to understand, and the operator deletes Pods by hand instead of fixing the desired-state description.
- In real deployments: Incidents should be read as "which controller is failing to pull reality back to the desired state", so
kubectl describeandkubectl get eventare the starting point, not the application logs.
-
Pod — the smallest schedulable unit
- Why: A Pod is a group of one or more containers that share a network namespace and IPC, always sit on the same node, and are the unit the scheduler assigns to a node (Kubernetes: pods). Because they share the network namespace, containers in a Pod call each other through
localhostand cannot occupy the same port. Each Pod has its own IP in the pod range. Consequence: the unit to reason about for resources, networking and lifecycle is the Pod, not the container. A READY column such as1/2reads as "the Pod has two containers, one is not ready yet". - When it breaks: Treating a Pod as a container leads to cramming several unrelated processes into one Pod, and then losing the ability to scale or restart parts independently because the whole Pod is one unit.
- In real deployments: One responsibility per Pod; a helper container (log reader, proxy) lives in the same Pod only when it truly needs to share the network or a volume with the main container.
- Why: A Pod is a group of one or more containers that share a network namespace and IPC, always sit on the same node, and are the unit the scheduler assigns to a node (Kubernetes: pods). Because they share the network namespace, containers in a Pod call each other through
-
Node and kubelet
- Why: A node is a machine that runs workloads; each node has a kubelet that receives the Pods assigned to it, calls the runtime to build the containers, runs probes and reports status back up to the apiserver (Kubernetes: nodes). The kubelet exposes its API on port
10250/TCPand by default refuses to start when it detects swap is enabled (kubeadm: before you begin). The lab cluster already has swap turned off, so this point does not get in the way. Consequence: a node losing contact does not immediately stop the containers on it — the kubelet keeps containers alive without needing the apiserver. The status inkubectl get podat that moment is stale information, not current truth. - When it breaks: Trusting the STATUS column absolutely while a node is disconnected leads to wrong conclusions; two copies of the same workload may run at the same time during the wait before the node is marked not ready.
- In real deployments: Monitoring must track both node health and Pod health; looking only at Pods will miss the class of incident where a node loses contact.
- Why: A node is a machine that runs workloads; each node has a kubelet that receives the Pods assigned to it, calls the runtime to build the containers, runs probes and reports status back up to the apiserver (Kubernetes: nodes). The kubelet exposes its API on port
-
Three address planes
- Why: The cluster has three ranges with different roles: the node network (the machines' real range), the pod CIDR (one IP per Pod, assigned by the CNI), and the service CIDR (virtual IPs for Services). The Kubernetes network model requires that Pods on two different nodes communicate directly without NAT (Kubernetes: cluster networking). The three ranges must not overlap. On the lab cluster, the node network consists of three real ranges,
192.0.2.0/24,198.51.100.0/24and203.0.113.0/24(three NICs per machine); the default kubeadm service CIDR is10.96.0.0/12(kubeadm init); the pod CIDR is decided by the CNI plugin and must avoid all three lab ranges as well as172.17.0.0/16ofdocker0. Multiple node ranges do not create an additional address plane — all three are still the node network. Consequence: every network fault in the cluster begins with the question "which plane is this packet on right now". The real address can be pinged, the other two cannot, and that is by design. - When it breaks: Choosing a pod CIDR that overlaps an infrastructure range sends packets in the wrong direction right from the node; the symptom is Pods on other nodes being unable to reach each other even though the cluster reports Ready.
- In real deployments: Settle and record the three ranges before
kubeadm init; changing the ranges after the cluster is running costs more than rebuilding the cluster.
- Why: The cluster has three ranges with different roles: the node network (the machines' real range), the pod CIDR (one IP per Pod, assigned by the CNI), and the service CIDR (virtual IPs for Services). The Kubernetes network model requires that Pods on two different nodes communicate directly without NAT (Kubernetes: cluster networking). The three ranges must not overlap. On the lab cluster, the node network consists of three real ranges,
-
etcd — the single source of truth
- Why: etcd is the key-value store that holds every object in the cluster; kube-apiserver is the only component that talks to it, over port
2379/TCPfor clients and2380/TCPbetween members (Kubernetes: ports and protocols, etcd data model). Because every declaration and every Secret lives here, an etcd backup is a cluster backup; worker nodes keep no copy of any declaration (Kubernetes: backing up an etcd cluster). Consequence: rebuilding a cluster after an incident means restoring etcd, not reinstalling applications. In the single-control-plane lab cluster, etcd is also a known single point of failure. - When it breaks: Backing up applications while skipping etcd turns a control plane incident into the loss of the entire cluster description; there is nowhere else to read the replica counts, ConfigMaps or Secrets back from.
- In real deployments: Back up etcd on a schedule and test restores periodically; a backup that has never been test-restored does not count as a backup.
- Why: etcd is the key-value store that holds every object in the cluster; kube-apiserver is the only component that talks to it, over port
-
CRI and CNI — two things Kubernetes does not do itself
- Why: Kubernetes hands two jobs off through standard interfaces: creating containers (CRI, the kubelet calls containerd over a socket) and assigning IPs to Pods (a CNI plugin) (Kubernetes: CRI, Kubernetes: network plugins). Without either one, the cluster comes up but cannot run workloads: without CRI,
kubeadm initstops at preflight; without CNI, the node reportsNotReadyand Pods stay atContainerCreating. Consequence: these two components must be chosen and installed deliberately before building the cluster. On the lab cluster, containerd is present but its CRI is disabled, and there is no CNI yet — those are the first two tasks of Part 2. - When it breaks: Mistaking these two failures for "kubeadm init is broken" leads to reinstalling the cluster many times when the cause is only one line of runtime configuration or an add-on that has not been installed.
- In real deployments: Record the runtime version and the CNI version in the cluster documentation alongside the Kubernetes version; these three numbers constrain each other during upgrades.
- Why: Kubernetes hands two jobs off through standard interfaces: creating containers (CRI, the kubelet calls containerd over a socket) and assigning IPs to Pods (a CNI plugin) (Kubernetes: CRI, Kubernetes: network plugins). Without either one, the cluster comes up but cannot run workloads: without CRI,
Step 1 — Read the minimum requirements and node identity before thinking about any command
The kubeadm documentation requires every machine to have ≥ 2 GB of RAM, control plane nodes to have ≥ 2 CPUs, and a unique hostname, MAC and product_uuid across nodes, because Kubernetes uses these values to tell nodes apart (kubeadm: before you begin). Virtual machines cloned from the same template very easily end up with duplicate values for the last two.
When it breaks: Two nodes with the same product_uuid make the cluster treat them as one; a node that joins later overwrites the earlier node's record, and the symptom is a node "disappearing" from kubectl get node for no obvious reason.
for h in 11 12 13 14; do
echo "192.0.2.$h -> $(ssh [email protected].$h "cat /sys/class/dmi/id/product_uuid")"
done
Observe with:
cat /sys/class/dmi/id/product_uuid, ip link, free -m, nproc as in the checking guidance of kubeadm: before you begin
Note: Measured results on the lab cluster on 2026-09-09: 4 different values, different MACs, different machine-ids — this item passes.
Step 2 — Declare the desired state: spec is the input, status is the output
A Deployment object that declares replicas: 3 means "the cluster must always have 3 Pods", not "create 3 Pods now". The apiserver validates and then stores the object; the status part is left empty for the system to write (Kubernetes: objects).
When it breaks: Reading spec as an execution log leads to the conclusion "3 Pods have been created" while status.availableReplicas is still 0 — the two fields answer two different questions.
apiVersion: apps/v1
kind: Deployment
metadata:
name: web
spec:
replicas: 3 # desired
selector:
matchLabels:
app: web
template:
metadata:
labels:
app: web
spec:
containers:
- name: web
image: nginx:alpine
Observe with:
kubectl get deploy web -o jsonpath="{.spec.replicas} / {.status.availableReplicas}" — compare desired with actual directly
Step 3 — The apiserver is the only door, etcd is where state rests
Every component reads and writes state through kube-apiserver on port 6443/TCP; only the apiserver talks to etcd (Kubernetes: components, ports and protocols). This hub-and-spoke architecture means every change passes through a single place for authentication, authorization and auditing.
When it breaks: Editing data directly in etcd bypasses all of the apiserver's validation, leaving invalid objects that controllers cannot process.
nc -z 127.0.0.1 6443 && echo "6443 BUSY" || echo "6443 FREE"
ss -lntp | grep -E "6443|2379|2380"
Observe with:
nc -z 127.0.0.1 6443 to find out whether anything is already listening on the port; ss -lntp | grep -E "2379|2380" to see etcd (man 8 ss)
Note: On the lab cluster, all 4 VMs return FREE — no control plane is running yet, exactly as expected before Part 2.
Step 4 — The scheduler assigns a Pod to a node, and assigns it only once
kube-scheduler finds Pods that do not yet have a nodeName, filters nodes by remaining resources, taints/tolerations and affinity, then writes the node name into the Pod (Kubernetes: kube-scheduler). This decision is written into the object, and only then does that node's kubelet act.
When it breaks: If no node matches, the Pod stays Pending indefinitely; the cluster reports no error at the Deployment level, so looking at kubectl get deploy makes you think progress is being made.
Observe with:
kubectl get pod -o wide to see the NODE column; kubectl describe pod to read the FailedScheduling event
Symptoms when it breaks:
- The Pod stays
Pendingand the NODE column is empty: The event inkubectl describe pod:FailedScheduling 0/3 nodes are available: 3 Insufficient cpu— or the corresponding taint/affinity reason
How to fix:
-
Read the specific reason in the event before changing anything
kubectl describe pod <pod> | sed -n "/Events/,$p" -
Lower the workload's requests or add nodes — on the lab cluster each node has only 2 vCPUs, so requests must be small
kubectl get node -o custom-columns=NAME:.metadata.name,CPU:.status.allocatable.cpu
Step 5 — kubelet calls containerd through CRI — where the lab cluster is currently blocked
The kubelet does not create containers itself: it calls the runtime through the CRI socket, which on the lab cluster is /run/containerd/containerd.sock (Kubernetes: CRI). The containerd package installed alongside Docker leaves behind the configuration disabled_plugins = ["cri"], meaning the part that serves Kubernetes is turned off (containerd: CRI plugin config).
When it breaks: The preflight checks of kubeadm init include a container runtime item; if the runtime does not serve CRI, this step stops, while systemctl status containerd still reports active, so it is easy to think the two are unrelated.
grep -n "disabled_plugins" /etc/containerd/config.toml
ls -l /run/containerd/containerd.sock
containerd --version
Observe with:
grep disabled_plugins /etc/containerd/config.toml; after installing crictl, crictl info confirms that CRI is being served
Symptoms when it breaks:
kubeadm initfails at the preflight step even though containerd isactive (running): The container-runtime group of preflight errors — kubeadm checks the runtime before initializing the control plane (kubeadm troubleshooting). The exact message strings are generated by the kubelet/containerd; the lab cluster does not have kubeadm installed yet, so the real log will be captured again in Part 2 and is not presented here as measured data.
How to fix:
-
Regenerate containerd's default configuration (the default does not disable CRI) and restart — a task for Part 2
containerd config default > /etc/containerd/config.toml && systemctl restart containerd -
Set the systemd cgroup driver to match the kubelet on a cgroup v2 system
grep -n "SystemdCgroup" /etc/containerd/config.toml
Note: The lab cluster uses cgroup v2 (stat -fc %T /sys/fs/cgroup returns cgroup2fs), so the kubelet and containerd must both use the systemd driver.
Step 6 — CNI assigns IPs to Pods — without it the node never becomes Ready
Kubernetes does not ship with a network plugin preinstalled. A CNI plugin assigns an IP to each Pod and builds the path between Pods on different nodes, satisfying the network model's "Pod to Pod without NAT" requirement (Kubernetes: network plugins, cluster networking).
When it breaks: After kubeadm init with no CNI installed yet, kubectl get node returns NotReady and the CoreDNS Pod stays Pending — the kubeadm documentation states clearly that this is the CORRECT state until a pod network add-on is installed, not a failed cluster install.
Observe with:
ls /etc/cni/net.d; kubectl get node; kubectl describe node to read the Ready condition
Symptoms when it breaks:
- The node is
NotReadyright after init, andcorednsis stuck atPending: The kubeadm documentation describes exactly this phenomenon in the section "coredns is stuck in the Pending state": kubeadm does not pick a network provider for you, so CoreDNS can only run after a pod network add-on is installed (kubeadm troubleshooting). The contents of the node's condition will be recorded from the lab cluster in Part 2.
How to fix:
-
Install a CNI plugin and declare a pod CIDR that matches the parameter used at init — settled in Part 2
kubeadm init --pod-network-cidr=<the range you settled on> -
Check that the pod range does not overlap the lab's three node ranges or docker0's 172.17.0.0/16
ip -4 route | grep -E "192\.0\.2\.|198\.51\.100\.|203\.0\.113\.|172\.17\."
Step 7 — A Service is a virtual address, CoreDNS is how you call it by name
A Service gives a group of Pods one IP and one stable name; that IP comes from the service range and is implemented by kube-proxy as netfilter rules on each node, not attached to any interface (Kubernetes: service, virtual IPs). CoreDNS resolves <service>.<namespace>.svc.cluster.local to that IP (DNS for services and pods).
When it breaks: Checking a Service with ping gives a silent result and leads to a wrong conclusion; a Pod gets a new IP every time it is recreated, so calling a Pod IP directly is a sure way to break things.
kubectl get svc -A
kubectl get endpointslice -A | head
kubectl run probe --rm -it --image=busybox:1.36 --restart=Never -- \
wget -qO- http://web.default.svc.cluster.local
Observe with:
kubectl get svc -A; kubectl get endpointslice to see which Pods stand behind the Service; iptables-save | grep KUBE-SVC | head to see the real rules
In real deployments: Applications call each other by Service name, not by Pod IP — that way recreating or scaling Pods does not break the caller's configuration.
Common misconceptions
- Wrong: Kubernetes replaces Docker, so a machine with Kubernetes installed no longer needs a container runtime. Right: Kubernetes does not create containers. It orchestrates and always calls a container runtime through the CRI interface — on the lab cluster, that is containerd.
Kubernetes defines an interface called CRI (Container Runtime Interface): the kubelet sends requests to create/delete containers over gRPC to the runtime, and the runtime is responsible for building the real namespaces, cgroups and processes (Kubernetes: container runtime interface). Without a runtime, the kubelet cannot build anything. The confusing part is an old compatibility layer called dockershim: the kubelet once talked to Docker Engine through this layer, and the layer was removed from Kubernetes as of version 1.24 (Dockershim removal FAQ). Removing dockershim does not mean Docker images can no longer be used — OCI-standard images still run; only the component that talks to the kubelet changed. Consequence on the lab cluster: all three nodes already have containerd v2.3.3, but the file /etc/containerd/config.toml declares disabled_plugins = ["cri"] — the default configuration of the package installed from the Docker repo (containerd: CRI plugin config). In that state the runtime works for Docker but does not serve the kubelet.
- Wrong:
kubectl applyis the command that creates containers, and when it finishes the job is done. Right:kubectl applyonly writes an object describing the desired state into the cluster's store. Creating containers is done afterwards by controllers and the kubelet, and they redo it whenever reality drifts from the description.
Every Kubernetes resource is an object with two parts: spec records the desired state declared by the user, and status records the observed state written by the system (Kubernetes: objects). kubectl apply sends the spec to kube-apiserver and ends there (kubectl apply). Once the object is in the store, controllers watch it, compare spec with status, then act to close the gap — this model is called the controller pattern and it runs continuously, not just once (Kubernetes: controllers). Delete a Pod belonging to a Deployment by hand and the next iteration of the loop creates a new Pod. Consequence when debugging: the right question is not "did the apply command error" but "was the object written correctly, and which controller is failing to pull reality back to the desired state". That is why kubectl describe and kubectl get event say more than the output of apply.
- Wrong: A Pod is just another name for a container in Kubernetes. Right: A Pod is the smallest unit Kubernetes schedules, and a Pod can contain several containers that share a network namespace and volumes.
A Pod is a group of one or more containers that share a network namespace and IPC and may share volumes; containers in the same Pod call each other through localhost and always sit on the same node (Kubernetes: pods). Kubernetes schedules by Pod, not by container. Because a Pod has one shared IP address, two containers in the same Pod cannot occupy the same port — this is a direct constraint of sharing the network namespace. This model is the foundation of sidecar patterns: one container serves, while another beside it reads logs or acts as a proxy. Consequence when reading commands: kubectl logs <pod> needs an extra -c <container> when the Pod has multiple containers, and kubectl get pod showing 1/2 in the READY column means the Pod has two containers of which only one is ready — not "one and a half Pods".
- Wrong: Kubernetes heals itself, so a cluster with a single control plane node is still safe when that node has a problem. Right: Self-healing applies to workloads: when a Pod dies, the controller recreates it. The control plane itself does not replicate itself — a single control plane node is a single point of failure.
The self-healing ability comes from controllers: they watch the actual number of Pods and recreate them to match the desired number (Kubernetes: controllers). But the controllers and the state store both run on the control plane; losing that node means losing the place where desired and actual state are compared. A multi-control-plane cluster must be built deliberately: multiple apiserver replicas behind a load balancer and etcd in a multi-member model (kubeadm: high availability topology). All of the cluster's declarations live in etcd, so etcd is what you must back up, not an application directory (Kubernetes: backing up an etcd cluster). Consequence on the single-control-plane lab cluster: Pods already running on workers keep running when cp-1 is shut down, because the kubelet does not need the apiserver to keep containers alive; but every change, every kubectl command, and the recreation of Pods all stop. That is a limitation to know in advance, not an error to fix in the lab.
- Wrong: A Service's IP is the IP of a machine or a Pod, so you can ping it to check whether it is alive. Right: A Service's IP is a virtual address: it is not attached to any network card and no process listens on it. The kernel on the node rewrites the packet's destination to a real Pod IP.
A Service has one stable IP taken from the service range, and kube-proxy builds netfilter rules (iptables or IPVS) on each node to forward packets to the IP of the Pods behind it (Kubernetes: virtual IPs and service proxies). That IP exists as a rule, not as an interface. This is why ping to a Service IP usually gets no reply and arp cannot look it up — the rule only applies to traffic going to the exact port the Service declares. The Service name resolves thanks to CoreDNS, in the form <service>.<namespace>.svc.cluster.local (Kubernetes: DNS for services and pods). Consequence when debugging: concluding "the Service is dead" from a single ping is heading in the wrong direction. The right test is to check whether the Service's EndpointSlice has any Pods, and then call the exact port with curl from inside a Pod in the same cluster.
Hands-on 1 — Inventory the 4 lab VMs against kubeadm's requirements
20 minutes
Build a pass/fail checklist before installing, instead of discovering errors one at a time through failed kubeadm init runs. The minimum requirements and how to check them come from kubeadm: before you begin.
cat /sys/class/dmi/id/product_uuid ; free -m ; nproc ; swapon --show ; timedatectl
Observation: Compare the three identity values across the 4 machines; check RAM/CPU against the thresholds of 2 GB and 2 CPUs; see whether swapon --show is empty
1. SSH in turn into cp-1, worker-1, worker-2, log-1 (user root) and run hostnamectl --static; timedatectl show -p Timezone --value.
Four different hostnames: cp-1, worker-1, worker-2, log-1. All four timezones are Asia/Ho_Chi_Minh.
2. On each machine: cat /sys/class/dmi/id/product_uuid and ip -br l | grep ^ens to get the MACs of all three NICs.
Four different product_uuid values, and 12 MACs (4 machines × 3 NICs) all pairwise different. A duplicate in any value is a blocker: the cluster would treat two machines as one node.
3. Check resources: nproc; free -m | awk "NR==2{print \$2}"; df -h /.
2 vCPUs and 3911 MiB of RAM per machine — above the minimum thresholds. / = 30 GB, with 21–22 GB free after growing the virtual disk from 16 to 32 GB and extending it fully into / on 2026-09-10: plenty of room for the control plane and CNI images.
4. Check swap and the API port: swapon --show; nc -z 127.0.0.1 6443 && echo BUSY || echo FREE.
swapon --show prints nothing (swap is off) and port 6443 returns FREE.
5. See whether there is any room left to grow the disk: vgs; lsblk -dno SIZE /dev/sda.
The virtual disk is 32 GB and ubuntu-vg has VFree equal to 0 — everything has been allocated to /. To get more space you must grow the disk in vCenter, then rescan inside the guest (echo 1 > /sys/class/block/sda/device/rescan) before it becomes visible: the kernel does not detect on its own that the disk got bigger. After that, growpart → pvresize → lvextend → resize2fs.
6. Record the results as a two-column pass/fail table.
Six items pass (hostname, timezone, identity, swap, port 6443, disk space) and three items fail (CRI, br_netfilter, kube* packages).
Analysis
Observation: Most of the preparation items are done; what is still missing lies at the runtime layer and the package layer, not at the virtual machine layer.
Mechanism: Kubernetes tells nodes apart by hostname, MAC and product_uuid; the kubelet refuses to run when it sees swap; the apiserver needs port 6443 to be free. That is why the four checks above are mandatory, not a formality.
Takeaway: Preflight is a checklist you read first, not an error message you receive afterwards. Knowing the three missing items in advance lets Part 2 run in a single pass.
Troubleshooting:
- SSH to a lab VM hangs with no response: The three lab ranges sit behind the lab OpenVPN; without the VPN there is no route. Only the management range
192.0.2.0/24goes through the VPN — the two secondary ranges198.51.100.0/24and203.0.113.0/24are isolated L2 segments, pingable only from inside the lab VMs themselves. A silent ping from a dev machine to the two secondary ranges is normal, not a dead VM. timedatectlreports the timezone asEtc/UTC: Reset it withtimedatectl set-timezone Asia/Ho_Chi_Minh(man 1 timedatectl). Timezone skew between nodes makes centralized logs hard to correlate by time.ncis not on the machine: Usess -lnt | grep 6443to see whether anyone is listening on that port, or installnetcat-openbsd.
Hands-on 2 — Inspect the two things that will block kubeadm init — read only, no fixes yet
15 minutes
The lab cluster's two failing items both belong to the runtime layer and the kernel module layer: containerd's CRI is off, and the br_netfilter module is not loaded. Read them first so you recognize the error message when it appears, instead of guessing (Kubernetes: CRI, man 8 lsmod).
grep -n disabled_plugins /etc/containerd/config.toml ; lsmod | grep br_netfilter
Observation: systemctl status containerd shows the service active while CRI is still off — two different things
1. On cp-1: containerd --version; systemctl is-active containerd.
v2.3.3 and active — the runtime is running normally for Docker.
2. Read the configuration: grep -n "disabled_plugins" /etc/containerd/config.toml.
You see the line disabled_plugins = ["cri"]. This is why kubeadm init will report [ERROR CRI] even though the service is active.
3. Compare with containerd's default configuration without overwriting anything: containerd config default | grep -n -m1 "disabled_plugins".
The default does not turn off cri — this difference is produced by the package installed alongside Docker, not containerd's default.
4. Check the modules and sysctl: lsmod | grep -E "br_netfilter|overlay"; sysctl net.ipv4.ip_forward.
overlay is present, br_netfilter is not, net.ipv4.ip_forward = 1.
5. Look at the sysctl path that kubeadm will check: ls /proc/sys/net/bridge/ 2>&1.
Either the directory is missing or bridge-nf-call-iptables is missing — because this file only appears after br_netfilter is loaded. The kubeadm preflight reports it in the form FileContent--proc-sys-net-bridge-bridge-nf-call-iptables.
6. Repeat steps 2 and 4 on worker-1 and worker-2.
All three nodes are in the same state — the fix in Part 2 applies to all three, not just the control plane.
Analysis
Observation: The runtime service is active but the part that serves Kubernetes is turned off; the bridge filtering module is not loaded, so the sysctl file that kubeadm checks does not exist yet.
Mechanism: containerd splits its functionality into plugins: with the cri plugin turned off, the socket still exists but does not serve the runtime.v1.RuntimeService API that the kubelet calls. br_netfilter is the module that creates the sysctls allowing netfilter to see traffic passing through a bridge — the foundation for kube-proxy to build Service rules.
Takeaway: active does not mean fulfilling the role you need. Checking through the exact interface that the other component will call is the only check that means anything.
Troubleshooting:
containerd config defaulterrors or has no output: Run it as root. This command only prints to stdout and does not write a file — it is safe to read and compare.- You want to try loading
br_netfilterright now:modprobe br_netfilterloads it immediately but it is lost after a reboot; the persistent configuration via/etc/modules-load.d/belongs to Part 2 so all three nodes do it at the same time.
Hands-on 3 — Compare the lab topology with the three-range design and settle the three address planes
20 minutes
The lab cluster is built on a design commonly seen in introductory material: each node has three NICs, each NIC attached to its own range — here 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24. These three ranges are all the node network — they are not the three address planes of Kubernetes, even though both count to three. Confusing the two leads to choosing a pod CIDR that overlaps an infrastructure range, and packets going the wrong way right from the node (Kubernetes: cluster networking).
ip -br -4 addr show | grep ^ens ; ip -4 route ; ip neigh show dev ens224
Observation: ip -4 route shows which ranges really exist on the machine and which one has the default route; kubeadm init will receive the pod range through the --pod-network-cidr parameter
1. On each node: ip -br -4 addr show | grep ^ens and ip -4 route.
Three NICs: ens160 = 192.0.2.x/24, ens224 = 198.51.100.x/24, ens192 = 203.0.113.x/24 (x is the machine's last octet, 11–14). Only one default route, via gateway 192.0.2.1 on ens160; the other two ranges have only link-scope routes. In addition, docker0 holds 172.17.0.0/16.
2. Don't guess which NIC belongs to which range from its name. Get each NIC's MAC: ip -br l | grep ^ens, then match it against the MAC of the corresponding Network adapter in the VM's Edit Settings in vCenter.
Interface names follow PCI slot order, not range order: the NIC added first (prv1624) becomes ens192, the NIC added later (prv1623) becomes ens224. Only the MAC and the port group tell you for certain which NIC is on which range.
3. Ping across the whole cluster and count the number of probes; don't ping a few times at random and then conclude. A cluster of 4 machines × 3 ranges = 12 destination addresses, and pinging all 12 from each machine → 48 probes in total:
p=0; f=0
for n in 192.0.2 198.51.100 203.0.113; do for d in 11 12 13 14; do
ping -c1 -W1 $n.$d >/dev/null 2>&1 && p=$((p+1)) || f=$((f+1))
done; done
echo "ok $p / failed $f"
Each machine returns ok 12 / failed 0, which adds up to 48/48. This number is a count of probes, not a percentage, and it distinguishes how badly things are broken: if only the management range is alive you get 16/48; if one machine has one NIC down you get 44/48. Of the 48 probes, 12 are a machine pinging itself — it sounds redundant but it confirms the NIC is really UP and has an IP, rather than the configuration only existing in a file.
4. A successful ping is not enough to conclude that the three NICs sit on three different port groups. Read the ARP table per interface: ip neigh show dev ens160, ... dev ens224, ... dev ens192.
The same destination machine must return three different MACs on the three interfaces — a separate virtual NIC for each range. If two NICs were mistakenly plugged into the same port group, ping would still be 48/48, and only the duplicated MAC would give it away. This is the only test in this article that catches a wrong port group assignment.
5. Check that the two secondary ranges really are isolated L2: ping -c1 -W1 198.51.100.1 and ping -c1 -W1 203.0.113.1 (the .1 address — where the gateway would be if the range had one).
There is no response, and ip neigh records those two addresses in the INCOMPLETE state — there is no gateway on these two ranges. That is why the default route must sit on ens160: put it in the wrong place and the node loses its path to the Internet.
6. Record the three-plane table: node network = the three real ranges above; pod CIDR = the range to be settled in Part 2; service CIDR = 10.96.0.0/12 (the kubeadm default).
A three-row table, each row stating clearly who allocates it and whether the address is real or virtual. The three NICs fit entirely within the first row.
7. Pick a candidate pod range and check that it does not overlap any range that exists: ip -4 route | grep -E "192\.0\.2\.|198\.51\.100\.|203\.0\.113\.|172\.1[78]\.".
The chosen range does not appear in the existing route table, and does not overlap 192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24 or 172.17.0.0/16.
8. Draw a diagram of each machine's role: cp-1 control plane, worker-1 worker 1, worker-2 worker 2, log-1 centralized logging — each machine keeps the same last octet (.11–.14) across all three ranges.
The diagram has 4 boxes connected to three buses (the three ranges), of which log-1 sits outside the K8s cluster.
9. Answer in words: why is the log machine placed outside the cluster instead of running as a Pod inside it?
Because the cluster's logs must be readable exactly when the cluster is broken; running inside the cluster would lose them along with the cluster.
Analysis
Observation: The lab cluster has exactly three ranges as designed, but all three are node networks and only one range has a path to the outside.
Mechanism: The number of NICs and the number of address planes are two independent matters: the pod CIDR is built by the CNI on top of the node network, and the service CIDR exists only as netfilter rules on each node. A one-NIC cluster still has all three planes; a three-NIC cluster still has just one node plane.
Takeaway: The topology must reflect what was measured, not what the design on paper describes. With multiple node ranges you must state explicitly which range the apiserver listens on, because kubeadm by default picks the range of the default route. And each check answers only its own question: ping answers "can the packet get there", while the MACs in the ARP table answer "are these two different networks".
Troubleshooting:
- Not sure which pod range to choose: The pod range goes with the CNI plugin and the
--pod-network-cidrparameter ofkubeadm init; settle it at the same time as choosing the CNI in Part 2 so the two values do not drift apart. docker0and the172.18.xbridges occupy ranges and cause confusion: These are bridges created by Docker on the node. Record them in the table of ranges in use so the pod range does not overlap. The compose stack's bridge was removed along with its containers, butdocker0still holds172.17.0.0/16on all three nodes.
Review questions
Question 1. A cluster of 4 machines, each with 3 NICs on 3 ranges. A full cross-ping of 48/48 probes all succeed. Which conclusion is certain?
- The three NICs on each machine are certainly on three different port groups
- Layer 3 works on all three ranges; whether there are exactly three separate broadcast domains is still unknown
- The cluster is ready for kubeadm init because the network has no more problems
- A single working range is enough to get 48/48, so this number tells you nothing
Answer: Layer 3 works on all three ranges; whether there are exactly three separate broadcast domains is still unknown. Ping only proves the packet reaches the destination. If two NICs were mistakenly plugged into the same port group, both ranges would still ping fully and the number would still be 48/48. The test that can tell them apart is ip neigh show dev <iface>: the same destination machine must return three different MACs on the three interfaces. The other options: Answer 3 is wrong because a working network does not guarantee that ports 6443/10250 are free, that CRI is enabled or that swap is off. Answer 4 is wrong because if only the management range were alive the result would be 16/48, not 48/48 — the number does discriminate.
- Answer 3 is wrong because a working network does not guarantee that ports 6443/10250 are free, that CRI is enabled or that swap is off. Answer 4 is wrong because if only the management range were alive the result would be 16/48, not 48/48 — the number does discriminate.
Question 2. Which component actually creates containers on a node?
- kube-apiserver, because every request goes through it
- the container runtime (containerd), called by the kubelet through CRI
- kube-scheduler, because it chooses the node
- kubectl, because the apply command is issued from there
Answer: the container runtime (containerd), called by the kubelet through CRI. The kubelet receives the Pod assigned to it and then calls the container runtime through the CRI interface; the runtime builds the real namespaces, cgroups and processes (Kubernetes: CRI). The other options: the apiserver only receives and stores objects; the scheduler only writes the node name into the Pod; kubectl is a client that sends a request and finishes.
- the apiserver only receives and stores objects; the scheduler only writes the node name into the Pod; kubectl is a client that sends a request and finishes.
Question 3. What happens when you manually delete a Pod belonging to a Deployment with replicas: 3?
- The Deployment is left with 2 Pods until someone applies again
- The controller creates a new Pod so the number of Pods matches the desired number again
- The whole Deployment is deleted along with it
- The apiserver rejects the delete command
Answer: The controller creates a new Pod so the number of Pods matches the desired number again. The controller watches the actual number of Pods and compares it with spec.replicas, and acts when it sees a gap — this is the controller pattern running continuously (Kubernetes: controllers). The other options: No re-apply is needed because the desired state is already in the store; the Deployment is not deleted along with the Pod; the Pod delete command is valid and is executed.
- No re-apply is needed because the desired state is already in the store; the Deployment is not deleted along with the Pod; the Pod delete command is valid and is executed.
Question 4. On the lab cluster, kubeadm init will stop at preflight for which measured reason?
- Swap is on across all three nodes
- The product_uuid of the three nodes are identical
- containerd declares
disabled_plugins = ["cri"], so CRI is not served - Port 6443 is already taken by another process
Answer: containerd declares disabled_plugins = ["cri"], so CRI is not served. Checked on 2026-09-09: swap is off, the product_uuid values differ, port 6443 is still free; the item that fails is containerd's CRI being turned off in the default configuration of the package installed alongside Docker (containerd: CRI plugin config). The other options: The other three options were all checked and pass on all four lab VMs.
- The other three options were all checked and pass on all four lab VMs.
Question 5. How does a Service's IP respond to ping?
- It responds normally because it is attached to the control plane node
- It usually does not respond, because it is a virtual address implemented by netfilter rules
- It responds if the Service has at least one Pod behind it
- It responds but with higher latency than a Pod IP
Answer: It usually does not respond, because it is a virtual address implemented by netfilter rules. A Service IP is not attached to any interface; kube-proxy builds iptables/IPVS rules to rewrite the packet's destination to a real Pod, and the rules only apply to the exact port the Service declares (Kubernetes: virtual IPs and service proxies). The other options: That address does not belong to any machine; the number of Pods behind it does not make it answer ICMP; there is no ICMP path to speak of latency for.
- That address does not belong to any machine; the number of Pods behind it does not make it answer ICMP; there is no ICMP path to speak of latency for.
Question 6. The control plane node cp-1 is shut down while Pods are running on the two workers. Which phenomenon is correct?
- All Pods on the workers shut down with it within a few seconds
- The Pods keep running, but every kubectl command and every change stops
- The workers elect a new control plane on their own
- All Pods move to the remaining worker
Answer: The Pods keep running, but every kubectl command and every change stops. The kubelet keeps running containers alive without needing the apiserver; but the apiserver is the only door for reading/writing state, so kubectl and the controllers all stop (Kubernetes: components). The other options: There is no mechanism for self-electing a control plane in a cluster with a single control node; moving Pods requires a controller — which is not running.
- There is no mechanism for self-electing a control plane in a cluster with a single control node; moving Pods requires a controller — which is not running.
Question 7. What must be backed up in order to rebuild the cluster?
- The /var/lib/kubelet directory on each worker
- The images in the local registry
- The etcd data
- The operator's kubeconfig file
Answer: The etcd data. etcd holds every object in the cluster, including Secrets; the Kubernetes documentation treats an etcd backup as a mandatory step for recovery (Kubernetes: backing up an etcd cluster). The other options: Data on workers and images can both be rebuilt from the declarations; the kubeconfig is only an access credential and does not contain the cluster description.
- Data on workers and images can both be rebuilt from the declarations; the kubeconfig is only an access credential and does not contain the cluster description.
Question 8. Many older guides build a cluster with Kubernetes 1.22. Why not reuse that version for the lab cluster?
- Because 1.22 does not support containerd
- Because the old apt.kubernetes.io repo has been shut down and 1.22 is outside the branches that still receive patches
- Because Ubuntu 22.04 cannot run kubelet 1.22
- Because 1.22 requires a minimum of 4 vCPUs per node
Answer: Because the old apt.kubernetes.io repo has been shut down and 1.22 is outside the branches that still receive patches. The old Google repo was frozen on 2023-09-13 and shut down completely on 2024-03-04 (Legacy package repository deprecation); as of 2026-09-09 the branches still receiving patches are 1.35, 1.36 and 1.37 (kubernetes.io/releases). The other options: 1.22 already supports CRI with containerd; the minimum resource requirements are still 2 GB RAM and 2 CPUs for the control plane; the problem lies in the package source and the support lifecycle.
- 1.22 already supports CRI with containerd; the minimum resource requirements are still 2 GB RAM and 2 CPUs for the control plane; the problem lies in the package source and the support lifecycle.
Flashcards
-
How do spec and status differ? spec is the desired state declared by the user; status is the observed state written by the system. The gap between the two fields is exactly the input to the control loop, so reading this pair correctly is the first step when debugging.
-
What is the controller pattern? A continuous loop: watch resources, compare actual with desired, act to close the gap. Kubernetes' self-healing is a consequence of this loop, not a separate feature.
-
Which component is allowed to talk to etcd? Only kube-apiserver. Every other component reads/writes state through the apiserver. This hub-and-spoke architecture keeps all validation and authorization in one place.
-
Default ports: apiserver, etcd, kubelet? 6443/TCP (apiserver), 2379–2380/TCP (etcd client/peer), 10250/TCP (kubelet). Enabling a firewall without 6443 or 10250 makes node join fail — per Kubernetes: ports and protocols.
-
What is a Pod, and how many containers can a Pod hold? The smallest schedulable unit; it holds one or more containers sharing a network namespace, always on the same node. Because they share the network namespace, containers in a Pod call each other over localhost and cannot occupy the same port.
-
What does a "48/48" cross-ping mean on a 4-machine · 3-range cluster? 4 machines pinging × 12 destination addresses (4 machines × 3 ranges) = 48 probes, and all 48 got a response. It is a count of probes, not a percentage. If only the management range were alive and the other two were dead, the result would be 16/48 — the number tells you how badly it is broken.
-
Does pinging successfully across all three ranges prove that the three NICs are on exactly three port groups? No. You must read ip neigh for each interface: the same destination machine must return three different MACs. If two NICs were mistakenly plugged into the same port group, ping would still fully succeed, and only the duplicated MAC would give it away. Ping proves layer 3 reaches the destination, not that these are three separate broadcast domains.
-
What are the cluster's three address planes? Node network (real), pod CIDR (assigned to Pods by the CNI), service CIDR (virtual IPs of Services). The three ranges must not overlap. On the lab cluster the node network is the three real ranges 192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24; the default kubeadm service CIDR is 10.96.0.0/12.
-
Why can't a Service IP be pinged? Because it is a netfilter rule built by kube-proxy, not an address attached to any interface. The right test is to check the EndpointSlice and then curl the exact port from inside a Pod in the same cluster.
-
What does the kubelet do on a node? Receives the Pods assigned to it, calls the runtime through CRI to build containers, runs probes, and reports status back up to the apiserver. The kubelet keeps containers alive without the apiserver, so losing the control plane does not shut workloads down immediately.
-
What are CRI and CNI? CRI: the interface the kubelet uses to call the runtime to create containers. CNI: the plugin that assigns IPs to Pods and builds the Pod-to-Pod path. Kubernetes does not do these two jobs itself; without CRI, init fails preflight, and without CNI, the node is NotReady.
-
What is the typical sign that a cluster has no CNI installed? The node is NotReady, Pods stay at ContainerCreating, and describe node shows
cni plugin not initialized. Reading this sign correctly avoids reinstalling the cluster when the cause is only a missing add-on. -
Which three values must be unique across nodes? hostname, MAC address, product_uuid — check with
ip linkandcat /sys/class/dmi/id/product_uuid. VMs cloned from a template easily end up with duplicate values for the last two, making the cluster treat two nodes as one. -
What is the only thing that must be backed up to recover the cluster? The etcd data — where every object is stored, including Secrets. Worker nodes keep no copy of any declaration, so losing etcd means losing the cluster description.
-
Why put the log collector outside the K8s cluster? So the logs can still be read when the cluster itself is broken — on the lab cluster that is
log-1(192.0.2.14). A log stack running inside the cluster would be lost along with the cluster exactly when you most need to read the errors. -
What is the support lifecycle of a Kubernetes branch? The three most recent minor branches get patches, each for about a year; as of 2026-09-09 they are 1.35, 1.36, 1.37. The 1.22 that many older guides use is out of support, and the old apt.kubernetes.io repo has been shut down since 2024-03-04.