Search Pass4Sure

Building a Home Kubernetes Lab for CKA Exam Preparation

CKA lab setup guide: comparing Killercoda, k3s, local VMs, and cloud VMs, kubeadm installation steps, broken-cluster practice scenarios, and the hardware requirements that actually work.

Building a Home Kubernetes Lab for CKA Exam Preparation

Every CKA guide says "practice in a real Kubernetes cluster." Most stop there. The candidates who actually pass CKA don't just practice in a cluster — they practice in clusters that break in specific ways, forcing them to diagnose and fix the exact types of failures the exam tests. The difference between a candidate who studies in a clean, working cluster and one who deliberately breaks their cluster and repairs it is often the difference between passing and failing the troubleshooting domain (30% of the exam).

Setting up the right lab environment takes 2-4 hours. The setup decisions you make determine whether your practice time builds exam-relevant skills or just builds familiarity with a working Kubernetes deployment.


Lab Options Compared

Four approaches are commonly used. Each has specific tradeoffs:

Option Cost Setup Time CKA Readiness Limitations
Killercoda (browser) Free 0 minutes Good for scenario practice Sessions expire ~60 min, no persistence
k3s single-node Free 30 min CKAD prep, basic CKA No kubeadm, simplified control plane
Local VMs (VirtualBox/VMware) Free 2-4 hours Excellent — full kubeadm Requires 16GB+ RAM on host
Cloud VMs (AWS/GCP/Azure) $5-15/month 1-2 hours Excellent — full kubeadm Ongoing cost

Killercoda: Free Browser-Based Practice

Killercoda (killercoda.com) — a browser-based lab environment with community-maintained Kubernetes scenarios, including a dedicated CKA scenario set.

Killercoda is the best option for practicing specific kubectl commands and Kubernetes task patterns without any local setup. Sessions provide a real kubeadm cluster in the browser, accessible immediately.

What Killercoda does well:

  • Zero setup friction — start practicing within 30 seconds

  • CKA-specific scenarios covering every major exam domain

  • Real kubeadm clusters (not minikube or k3s)

  • Regular community scenario updates

What Killercoda can't do:

  • Sessions expire in ~60 minutes — can't build a broken cluster and leave it broken to diagnose later

  • Can't practice the full kubeadm cluster installation process (the environment exists already)

  • No persistence between sessions for note-taking or topology customization

Best use: daily short practice sessions on specific techniques, preparing for specific exam task types, verifying that your command syntax is correct.

k3s: Lightweight Kubernetes on Any Hardware

k3s — a lightweight Kubernetes distribution by Rancher/SUSE, designed for resource-constrained environments, using a single binary and SQLite instead of etcd by default.

k3s runs on a Raspberry Pi, an old laptop, or a VM with 2GB RAM. It's ideal for learning Kubernetes application deployment concepts (CKAD-level work). It's not ideal for CKA preparation because:

  • No kubeadm — the cluster installation and upgrade process (25% of CKA) can't be practiced

  • No standard etcd — etcd backup and restore (heavily tested on CKA) uses a different process

  • Simplified control plane — some control plane troubleshooting scenarios behave differently than in kubeadm clusters

k3s is the right tool for candidates who want to learn Kubernetes without the overhead of a full cluster. For CKA specifically, it's a partial solution.

Local VMs with VirtualBox: The Recommended CKA Lab

A three-node kubeadm cluster on local VMs provides the most complete exam preparation environment. The setup requires:

Hardware requirements:

  • Host machine with 16GB RAM (minimum) — 8GB works but leaves no headroom

  • 6+ CPU cores on the host

  • 50GB+ free disk space

VM configuration:

  • 3 Ubuntu 22.04 VMs: 1 control plane (2 vCPU, 2GB RAM), 2 workers (2 vCPU, 2GB RAM each)

  • Bridge or NAT networking with static IP assignments

Why Ubuntu 22.04: the CKA exam environment uses Ubuntu-based nodes. Practicing on the same OS prevents encountering surprising differences in package management, file paths, or service names during the exam.

VirtualBox vs VMware Workstation Player:

  • VirtualBox: free, cross-platform (Windows/Mac/Linux), slightly more configuration needed

  • VMware Workstation Player: free for personal use, better performance on Windows, simpler networking setup

Both work. The choice depends on what you're comfortable with.

Cloud VMs: The Portable Alternative

If your local machine can't run three VMs simultaneously (common on 8GB laptops), cloud VMs are the practical alternative.

GCP preemptible VMs (most cost-efficient):

  • e2-medium (2 vCPU, 4GB RAM): ~$0.01/hour on preemptible pricing

  • Three instances for a lab: ~$0.03/hour = $0.72/day if running continuously

  • With 4 hours/day usage: ~$22/month

AWS t3.small (wider documentation and community):

  • $0.0208/hour per instance × 3 = $0.0624/hour

  • With 4 hours/day usage: ~$7.50/month

Start, stop, and destroy instances when not in use. Create a startup script that installs Docker and kubeadm prerequisites automatically so you can rebuild clusters quickly.


Building the kubeadm Cluster

Installing a kubeadm cluster from scratch is a core CKA exam skill (25% of Cluster Architecture, Installation, and Configuration domain). Practice this until it takes under 20 minutes.

Step-by-step installation (all three nodes):

# 1. Disable swap (required by kubelet)
sudo swapoff -a
sudo sed -i '/ swap / s/^/#/' /etc/fstab

# 2. Load required kernel modules
cat <<EOF | sudo tee /etc/modules-load.d/k8s.conf
overlay
br_netfilter
EOF
sudo modprobe overlay
sudo modprobe br_netfilter

# 3. Set sysctl parameters
cat <<EOF | sudo tee /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-iptables  = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.ipv4.ip_forward                 = 1
EOF
sudo sysctl --system

# 4. Install containerd
sudo apt-get install -y containerd
sudo mkdir -p /etc/containerd
containerd config default | sudo tee /etc/containerd/config.toml
sudo systemctl restart containerd

# 5. Install kubeadm, kubelet, kubectl
sudo apt-get install -y kubeadm kubelet kubectl
sudo apt-mark hold kubeadm kubelet kubectl

On the control plane only:

sudo kubeadm init --pod-network-cidr=10.244.0.0/16

# Configure kubectl
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config

# Install CNI (Flannel)
kubectl apply -f https://raw.githubusercontent.com/flannel-io/flannel/master/Documentation/kube-flannel.yml

Join worker nodes using the kubeadm join command output from the kubeadm init command.

Practice this process multiple times. kubeadm init should take under 5 minutes when you're familiar with it.


The Broken-Cluster Practice Method

The most CKA-relevant practice you can do is deliberately breaking your cluster and fixing it. This builds the diagnostic thinking the troubleshooting domain (30% of exam) tests.

Scenarios to practice:

Scenario 1: Node Not Ready

# Break it:
sudo systemctl stop kubelet

# Symptoms: kubectl get nodes shows the node as NotReady
# Diagnosis: kubectl describe node <node-name> shows kubelet is not responding
# Fix: sudo systemctl start kubelet

Practice the diagnostic sequence: kubectl get nodeskubectl describe nodessh to node → sudo systemctl status kubelet → identify the issue → fix.

Scenario 2: Static Pod Not Running

# Break it: introduce a syntax error in a static pod manifest
sudo vi /etc/kubernetes/manifests/kube-apiserver.yaml
# Add an invalid line: badkey: badvalue

# Symptoms: kube-apiserver pod disappears or crashes
# Diagnosis: sudo crictl ps -a | grep apiserver; check logs
# Fix: remove the invalid line from the manifest

Static pods are managed by kubelet from manifests in /etc/kubernetes/manifests/. When a manifest has errors, the pod disappears. Finding and fixing static pod issues is directly tested on CKA.

Scenario 3: etcd Backup and Restore

# Backup:
ETCDCTL_API=3 etcdctl snapshot save /opt/etcd-backup.db \
  --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

# Verify backup:
ETCDCTL_API=3 etcdctl snapshot status /opt/etcd-backup.db

# Restore (to a different data directory):
ETCDCTL_API=3 etcdctl snapshot restore /opt/etcd-backup.db \
  --data-dir=/var/lib/etcd-backup

Practice the full backup command with all certificate paths until you can type it without documentation. The flags (--cacert, --cert, --key, --endpoints) and the certificate paths are what candidates forget under exam pressure.

"The candidates who pass CKA on the first attempt all tell me the same thing: they broke their lab cluster repeatedly and fixed it. Not once — repeatedly. The tenth time you diagnose a NotReady node, you don't have to think about it anymore. That automatic diagnostic process is exactly what the troubleshooting domain is testing." — Mumshad Mannambeth, KodeKloud founder and creator of the most widely used CKA preparation course


Lab Resource Requirements: The Realistic Assessment

Running a 3-node kubeadm cluster continuously on a laptop with 16GB RAM is feasible but leaves the host with about 10GB for the OS and applications. On a 8GB machine, it's not practical — a single VM would consume most available RAM.

The tiered approach: use Killercoda for daily practice on specific tasks (free, zero overhead). Build a local or cloud VM lab specifically for kubeadm installation practice, etcd backup/restore, and broken-cluster scenarios. This gives you the best of both: no-setup daily practice plus deep exam-specific preparation.


The killer.sh CKA Simulator: The Most Important Paid Resource

killer.sh (killer.sh) — a paid Kubernetes exam simulator that provides two full-length, performance-based practice exam sessions included with every CKA exam purchase.

The killer.sh CKA simulator is consistently harder than the real exam according to community reports. This is deliberate design: if you can score 70%+ on killer.sh, the real exam feels easier. If you score under 60% on killer.sh, you're not ready.

What killer.sh provides that Killercoda doesn't: exam-realistic time pressure (120 minutes), exam-realistic difficulty calibration, detailed solutions for every task showing the most efficient approach, and a persistent environment you can reset and retake. The two included sessions are worth exhausting — work through the first session, study the solutions in detail, wait a week, then retake the second session as a final readiness check.

The score interpretation:

  • Below 50%: significant knowledge gaps, not ready for the real exam

  • 50-65%: close but needs targeted practice on specific weak areas

  • 65-75%: likely passing range with minor improvements

  • 75%+: well prepared, consider scheduling within 1-2 weeks


Note-Taking During Lab Practice

Building a personal reference document during lab practice pays dividends during the exam. The CKA allows kubernetes.io/docs but not your own notes. What your notes can do is build mental models during study that make documentation navigation faster.

The technique cheat sheet approach: for every technique you practice, write a one-paragraph summary in your own words immediately after successfully implementing it. This forces synthesis and creates memorable mental anchors. "To drain a node: first kubectl cordon then kubectl drain --ignore-daemonsets --delete-emptydir-data" written in your own words sticks better than re-reading the documentation repeatedly.

The wrong-answer log: every time you fail a practice task, write down what you tried, why it failed, and what the correct approach was. Review these logs before taking killer.sh and before scheduling the real exam. Your personal failure patterns are more predictive of exam risk than aggregate difficulty ratings.


See also: CKA exam guide: the kubectl commands you must know cold, CKAD vs CKA: what each exam tests and which to take first

References

Frequently Asked Questions

Can I use Minikube to prepare for CKA?

Minikube is insufficient for CKA preparation. CKA tests kubeadm cluster installation (25% of exam), etcd backup/restore, and control plane troubleshooting — none of which Minikube provides. Use Killercoda for task-based practice, and set up a 3-node kubeadm cluster (local VMs or cloud VMs) for kubeadm installation, upgrade, and broken-cluster diagnosis practice.

How much RAM do I need for a home Kubernetes lab?

16GB RAM on the host machine is the practical minimum for a 3-node kubeadm cluster (each VM needs 2GB). 8GB machines can't run a functional 3-node cluster alongside a host OS. If your machine has 8GB or less, use cloud VMs (GCP preemptible instances cost approximately $5-15/month for a CKA-appropriate lab) or Killercoda for all practice.

What is Killercoda and is it enough for CKA?

Killercoda (killercoda.com) provides free browser-based kubeadm Kubernetes scenarios with sessions lasting ~60 minutes. It's excellent for daily kubectl command practice and specific technique work. It's not sufficient alone for CKA because sessions expire before you can practice kubeadm installation from scratch or work with broken-cluster scenarios that require persistence across multiple sessions.

What broken-cluster scenarios should I practice for CKA?

Practice: (1) worker node NotReady caused by stopped kubelet — diagnose via kubectl describe node and systemctl status kubelet; (2) static pod failure from corrupt manifest in /etc/kubernetes/manifests/ — diagnose via crictl ps -a; (3) etcd backup and restore with the full etcdctl command including all certificate flags; (4) kubeadm cluster upgrade from one minor version to the next.

Is k3s good enough for CKA preparation?

k3s is useful for learning Kubernetes application concepts (CKAD-level work) but insufficient for CKA preparation. k3s doesn't use kubeadm (25% of CKA), uses SQLite by default instead of etcd (making etcd backup practice impossible), and simplifies the control plane in ways that change troubleshooting behavior. Use a real kubeadm cluster for CKA preparation.