0%
Kubernetes CKA and CKAD Exam Prep: Hands On Task Drills and Mock Exams
How the Exams Work
Application Developer (CKAD) Skills
Mock Exams
Cluster Install and Upgrade with kubeadm
The administrator exam assumes you can stand up, extend and upgrade a cluster built with kubeadm, the reference bootstrap tool maintained by the Kubernetes project. You will not be asked to compile anything or to write systemd units from scratch, but you may be dropped onto a node where the packages are installed and asked to initialise a control plane, join a worker, upgrade a node by one minor version or fix an expired certificate. Every one of those tasks is easier if you can picture exactly what kubeadm leaves on disk, because a kubeadm cluster is mostly files: certificates, kubeconfigs and pod manifests, plus a kubelet that turns the manifests into running containers.
This lesson covers that picture, then the install flow, the join flow, the upgrade flow and certificate care. The next lesson owns etcd backup and restore, so etcd appears here only as one of the control plane static pods. Draining and cordoning appear in the upgrade section; the scheduling lesson covers them in more depth.
The pieces of a control plane node
A kubeadm control plane node runs four core components as pods: kube-apiserver, etcd, kube-controller-manager and kube-scheduler. They are not created through the API server, because the API server does not exist yet when the node boots. Instead, kubeadm writes four manifest files and the kubelet, running as an ordinary systemd service, starts them directly. Two more cluster add-ons are installed through the API once it is up: CoreDNS as a Deployment and kube-proxy as a DaemonSet.
Learn the directory layout cold, because exam tasks refer to it without explanation:
The split between admin.conf and super-admin.conf has existed since v1.29. admin.conf binds to a group with the cluster-admin ClusterRole, so it can be revoked through RBAC; super-admin.conf belongs to the system:masters group, which bypasses RBAC entirely. Use admin.conf for normal work.
The kubelet is the root of everything
On every node the kubelet is the one component that is not a container. It is a binary installed from a package and managed by systemd, configured by a drop-in file that kubeadm installs and by /var/lib/kubelet/config.yaml. When the kubelet is broken, nothing on that node runs, including the control plane pods on a control plane node. This is why so many exam troubleshooting tasks start with two commands:
The kubelet talks to the container runtime through the Container Runtime Interface. On exam clusters that runtime is almost always containerd, and the matching debugging tool is crictl, which lists containers even when the API server is down. Remember that kubectl needs a working API server; crictl only needs the local runtime socket.
Preflight requirements
kubeadm init and kubeadm join run preflight checks and refuse to continue when the machine is not ready. The checks you are most likely to meet are these. Swap must be off unless you have deliberately configured the kubelet for swap; the simple fix is swapoff -a plus removing the swap line from /etc/fstab. The br_netfilter kernel module must be loaded and net.ipv4.ip_forward must be 1, otherwise pod traffic cannot be routed or seen by iptables. The container runtime must be running. Preflight does not check the cgroup driver, but the runtime must still use systemd to match the kubelet, which in containerd means SystemdCgroup = true in the runc options; a mismatch shows up later as pods that keep restarting. Ports 6443, 2379 to 2380 and 10250 must be free.
On the exam the environment is usually prepared for you, so you are more likely to read a preflight error than to build a node from bare metal. Read the error line carefully: it names the failing check, and fixing that one thing is usually the whole task.
Packages and the community repositories
Kubernetes packages are published at pkgs.k8s.io, with one repository per minor version. That detail matters for upgrades: a node configured for the v1.33 repository cannot see v1.34 packages until you change the repository line. The three packages are kubeadm, kubelet and kubectl, and they are normally held so that a routine apt upgrade does not move them by accident.
On RPM based systems the equivalent repository file sits in /etc/yum.repos.d and you install with dnf, using --disableexcludes=kubernetes when the repo excludes the packages from normal updates. The exam can use either family; read the node's operating system before you type.
What the interviewer or examiner is checking
Whether the task is graded by a script or discussed in an interview, the check is the same: did you change the right component, in the right place, without breaking the rest? A grader looks at the API object or the file on disk afterwards. If you edit a static pod manifest and introduce a YAML error, the API server disappears and every later check fails. Keep a backup copy of any manifest you touch, outside the manifests directory, before you edit it.
Never put the backup inside /etc/kubernetes/manifests. The kubelet tries to run every file in that directory, and two manifests for the same component fight over the same ports.
Reading the control plane from the outside
Once a cluster is running, you can learn a lot about how it was built without opening a single file. kubectl get nodes -o wide shows each node's kubelet version, internal IP, operating system and container runtime. kubectl get pods -n kube-system shows the control plane pods with the node name appended, which tells you how many control plane nodes exist. kubectl -n kube-system get cm kubeadm-config -o yaml shows the ClusterConfiguration kubeadm stored at init time: the Kubernetes version, the control plane endpoint, the pod and service subnets and any extra API server arguments. That ConfigMap is also what kubeadm upgrade reads, so when an upgrade behaves unexpectedly, look there for an old setting that is being carried forward.
Two numbers in that output are worth noting at the start of any cluster task: the service subnet, which is where ClusterIP addresses come from, and the pod subnet, which must match what the CNI plugin was configured with. A mismatch between the pod subnet and the CNI configuration is one of the classic reasons a freshly built cluster has nodes that never become Ready.
The container runtime configuration
Because containerd sits underneath every pod, a misconfigured runtime looks like a Kubernetes failure even though no Kubernetes file is wrong. The file to know is /etc/containerd/config.toml. A fresh install may not have one at all, in which case containerd runs with built in defaults that use the cgroupfs driver, and the kubelet, which kubeadm configures for systemd, disagrees with it. Pods then start and die in a loop, or the kubelet refuses to start them. The fix is to generate a full default configuration, flip one setting and restart.
crictl itself needs to know which socket to use. It reads /etc/crictl.yaml, and on containerd nodes the runtime endpoint is unix:///run/containerd/containerd.sock. If crictl prints warnings about default endpoints or hangs, set that file once and the warnings go away. These details rarely appear as a task on their own, but they decide whether your troubleshooting tools work when you need them, so check them early on any node you are asked to repair.
Finally, remember that the kubelet will not start successfully until kubeadm init or kubeadm join has written its configuration. On a node that has packages but has never been initialised, systemctl status kubelet shows it restarting every few seconds. That is normal and not a fault to fix.
On a kubeadm control plane node, the four core components exist as files in /etc/kubernetes/manifests before they exist as pods. When the API server is down, work on the files and use crictl and journalctl, not kubectl.