By the end you'll know
- What the CKA exam is, how it's run and how it's scored
- The five domains, and why their weights should decide how you study
- How the drills in this track work, and what "ready" looks like
- How to set up the terminal the way you'll use it in the exam: an alias, tab completion and two shortcuts
- Why
--dry-run=clientworks with no cluster at all, and why that matters - What
localhost:8080in an error really means, and why not to reach for--validate=false - The pasted-block trap that catches people logging in to a machine
Before you start
- You need: Vagrant (opens in a new tab) and VMware Fusion or VirtualBox, as in the Linux track from Lesson 7 on, and about 6 GB of free memory for three small machines.
- You should know: the basics from the Kubernetes track. This track is about doing it fast and under pressure, not learning it for the first time.
- The practice folder:
git clone https://github.com/Kwamib/cka-practice.git - The output below is from real runs on the evening of November 23, 2026, in New York, on an Apple silicon Mac.
What the exam is
The Certified Kubernetes Administrator (CKA) is a hands-on exam from the Linux Foundation and the Cloud Native Computing Foundation (CNCF). There's no multiple choice. For two hours, you work in a real terminal on real clusters, doing tasks like "this node is NotReady, fix it" or "give this account permission to list pods in one namespace."
The essentials, as of late 2026:
| What | The detail |
|---|---|
| Format | About 15 to 20 hands-on tasks, across several clusters |
| Time | 2 hours |
| To pass | 66% |
| Retake | One free retake is included |
| Open book | Yes: the official Kubernetes documentation, in a browser inside the exam |
| Practice | Two sessions on an exam simulator come with your registration, 17 questions each, with 36 hours of access per session |
| Kubernetes version | Recent: v1.37 at the time of writing |
Check the official CKA page (opens in a new tab) before you book. The version, the price, the passing score, how long the certification lasts and the documentation you may open all change over time, and plenty of guides online are out of date. The curriculum was reworked in 2025, adding Helm, Kustomize, custom resources and the Gateway API, so a guide from before then is missing a fifth of the exam.
The five domains
The exam's tasks come from five domains, each worth a fixed share of the score:
| Domain | Weight | In this track |
|---|---|---|
| Troubleshooting | 30% | Lessons 3 and 4 |
| Cluster architecture, installation and configuration | 25% | Lessons 2, 5, 6 and 7 |
| Services and networking | 20% | Lessons 8 and 9 |
| Workloads and scheduling | 15% | Lesson 10 |
| Storage | 10% | Lesson 11 |
The weights should decide where your study time goes. Troubleshooting is almost a third of the score, and it's the domain where people who "know Kubernetes" most often struggle: under pressure, they jump straight to the logs and stay there. It gets two full lessons and a fixed method. Storage is a tenth: worth knowing well, but not worth a week.
How this track works
Every lesson after this one follows the same pattern: a real lab on the practice cluster you're about to build, the reasons behind each step, what went wrong when I did it, and then drills.
A drill is a task to do from a blank terminal, worded the way a real task might be. Try it first, without looking. Then open "Show the fast way" to compare your commands, and read the notes under them: they cover the part people usually get wrong.
Come back to a drill a few days later and do it again without looking at your last attempt. Getting it right twice, from nothing, is what makes it stick.
What "ready" looks like, before you book:
- Every drill in the track done cold, without looking anything up, on two different days.
- Both simulator sessions done. The simulator's makers say it's harder than the real exam, on purpose: use the first as a check a couple of weeks out, and the second as a final rehearsal.
- The timed mock exam in Lesson 12, finished inside two hours with time left to check your work.
- You can break the practice cluster in a way you haven't seen before, and fix it using the method from Lesson 3, without a lesson open.
The practice machines
Every lesson runs on a cluster you build yourself: three Ubuntu virtual machines on your own computer, one to run the control plane (the cluster's brain) and two workers to run apps. It's the closest you can get to the exam's clusters for free, and building it is itself on the exam.
This lesson builds the three machines and sets up the terminal. Lesson 2 turns them into a cluster.
(Your machine)
cd cka-practice
vagrant up 2>&1 | tee up.log
tail -15 up.log
vagrant up: buildscp1,worker1andworker2, and runsnode-setup.shon each one.2>&1: includes error messages with the normal output.| tee up.log: shows everything on screen and saves a copy inup.log, so nothing is lost if it scrolls away.tail -15 up.log: prints the last 15 lines.
It takes 10 to 15 minutes. Each machine ends the same way:
cp1: == ready: cp1 has v1.36.6, containerd 2.2.1
cp1: The kubelet restarts every few seconds until this node joins a cluster. That's normal.
...
worker1: == ready: worker1 has v1.36.6, containerd 2.2.1
...
worker2: == ready: worker2 has v1.36.6, containerd 2.2.1
node-setup.sh does what the kubeadm documentation says a machine needs before it can join a cluster:
- Swap off. The kubelet, the agent that runs pods on each node, refuses to start with swap on by default: Kubernetes needs to know exactly how much real memory a node has.
- Two kernel modules and three network settings, so container traffic can cross the network bridges and be forwarded between machines.
- containerd, the container runtime that actually runs the containers, set to the systemd cgroup driver.
- kubeadm, kubelet and kubectl at v1.36, held at that version so ordinary updates can't change them.
Why v1.36, when the exam uses v1.37? On purpose. Lesson 5 upgrades the cluster to the exam's version, for real, which is named in the exam's curriculum.
You may also see a line like this, for each machine:
==> cp1: Fixed port collision for 22 => 2222. Now on port 2250.
Each machine needs its own port on your computer for SSH, and 2222 was already taken, probably by a machine from another lab. Vagrant picked a free port by itself. vagrant ssh knows which, so there's nothing to do.
One setting worth checking
The kubelet and containerd both track how much CPU and memory each container uses, through Linux cgroups (control groups). They must agree on how. If they don't, pods restart for no obvious reason, which is one of the hardest setup problems to spot later. node-setup.sh sets containerd to use systemd for this, the same as the kubelet.
containerd 2 reorganized its settings file, and older setup guides change a setting that may not exist any more. So check, rather than trust:
(On cp1)
vagrant ssh cp1
sudo grep -n SystemdCgroup /etc/containerd/config.toml
109: SystemdCgroup = true
grep -n: finds the line, and shows its line number.
true: they agree.
The pasted-block trap
I first pasted vagrant ssh cp1 and all the commands after it as one block. Only the first line did anything useful: vagrant ssh opened a new session on the machine, and the lines after it never reached it. They were either lost while the connection started, or left waiting to run on my own computer after I logged out. Log in first, then paste. The same goes for ssh to any node: connect, wait for the new prompt, then run the commands.
Set up the exam terminal
The first two minutes of the exam are worth spending on this. Every task after saves seconds, and seconds add up across 15 to 20 tasks.
(On cp1)
cat >> ~/.bashrc <<'EOF'
alias k=kubectl
source <(kubectl completion bash)
complete -o default -F __start_kubectl k
export do="--dry-run=client -o yaml"
export now="--force --grace-period 0"
EOF
printf 'set tabstop=2 shiftwidth=2 expandtab\n' >> ~/.vimrc
source ~/.bashrc
cat >> ~/.bashrc <<'EOF' ... EOF: adds the lines between theEOFs to the end of your shell's startup file, so they apply every time you log in.>>adds to the file instead of replacing it.alias k=kubectl: typekinstead ofkubectl. You'll type it hundreds of times.source <(kubectl completion bash): Tab completes kubectl's commands, resource types and even the names of your pods.complete -o default -F __start_kubectl k: the same tab completion fork. Without this line, Tab works forkubectlbut not for the alias.export do=...andexport now=...: two shortcuts, saved as shell variables. How they work is explained below.set tabstop=2 shiftwidth=2 expandtab: in Vim, indent with two spaces, and turn Tab into spaces. YAML doesn't allow tab characters, and a mix of tabs and spaces is one of the commonest ways to break a file you're editing under time pressure.source ~/.bashrc: loads the new settings now, without logging out.
If Tab prints _get_comp_words_by_ref: command not found
That happened to me on cp1: I typed k apply -f web and pressed Tab, and got bash: _get_comp_words_by_ref: command not found. kubectl's completion script relies on helper functions from a separate package, bash-completion, which this machine didn't have. The fix:
sudo apt-get install -y bash-completion
source /usr/share/bash-completion/bash_completion
source ~/.bashrc
The practice folder's node-setup.sh now installs it, so a fresh vagrant up won't hit this. On any other Linux machine, it's the first thing to check when kubectl's Tab completion fails.
The exam environment may have the alias and tab completion set up already. Check with type k before you add anything. The two shortcuts and the Vim settings you add yourself.
type k
k version --client
k is aliased to `kubectl'
Client Version: v1.36.6
Kustomize Version: v5.8.1
type k: says whatkreally is.--client: shows kubectl's own version without contacting a cluster.
Notice Kustomize in the output. kubectl has it built in, so k apply -k works with nothing else installed. That matters in Lesson 7.
Let kubectl write the YAML
Writing YAML from scratch is slow, and one of the easiest ways to lose time in the exam. kubectl can write it for you, and the do shortcut makes that quick to ask for.
How the shortcut works
This line in your .bashrc created it:
export do="--dry-run=client -o yaml"
do="...": saves the text between the quotes in a shell variable calleddo. A variable is just a name for a piece of text.export: makes the variable available to every command you run in that shell, not just the line that set it.
When you type $do, with a dollar sign, the shell replaces it with the saved text before running the command. kubectl never sees $do. So these two lines are exactly the same:
k create deploy web --image=nginx $do
kubectl create deploy web --image=nginx --dry-run=client -o yaml
The two flags it stands for:
--dry-run=client: work out what the command would create, but don't create it.-o yaml: print the result as YAML.
To see what a variable holds, echo $do prints --dry-run=client -o yaml.
Use it without quotes: $do, not "$do". Without quotes, the shell splits the text at the spaces into three separate words, --dry-run=client, -o and yaml, which is what kubectl expects. In quotes, it would arrive as one long word, and kubectl would reject it. Normally you quote variables to be safe; here, the splitting is the point.
YAML without a cluster
There's no cluster yet. Does it work anyway?
k create deploy web --image=nginx $do
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: web
name: web
spec:
replicas: 1
selector:
matchLabels:
app: web
strategy: {}
template:
metadata:
labels:
app: web
spec:
containers:
- image: nginx
name: nginx
resources: {}
status: {}
It does. A client-side dry run happens entirely in kubectl, on your machine. It never talks to a cluster. That's what "client" means, as opposed to --dry-run=server, which sends the request to the cluster to be checked but not saved.
Compare that with a command that does need a cluster:
k get nodes
E1124 02:22:11.628966 8556 memcache.go:265] "Unhandled Error" err="couldn't get current server API group list: Get \"http://localhost:8080/api?timeout=32s\": dial tcp 127.0.0.1:8080: connect: connection refused"
...
The connection to the server localhost:8080 was refused - did you specify the right host or port?
localhost:8080 is the clue. kubectl finds its cluster in a configuration file, ~/.kube/config, called a kubeconfig. When there isn't one at all, kubectl falls back to trying localhost:8080, and nothing is there. So this error doesn't mean "the cluster is down". It means "this kubectl doesn't know which cluster to talk to." It usually means you're on a node, or using an account, without a kubeconfig. Lesson 2 creates the cluster and its kubeconfig, and this command starts working.
A dry run only prints. It saved no file and created nothing, which is easy to assume otherwise. To keep the YAML, send it into a file:
k create deploy web --image=nginx $do > web.yaml
ls -ltr
total 4
-rw-rw-r-- 1 vagrant vagrant 320 Nov 24 02:53 web.yaml
> web.yaml: sends the output into a file calledweb.yaml, instead of to the screen.ls -ltr: lists files in long form (-l), sorted by time (-t), newest last (-r).
So the exam habit is: generate, save, edit, apply.
k create deploy web --image=nginx --replicas=3 $do > web.yaml
vim web.yaml
k apply -f web.yaml
Edit only what the task asks for, then k apply -f web.yaml creates it on the cluster. That last step needs a cluster, so it works from Lesson 2 on.
Try it now anyway, and the error is different:
k apply -f web.yaml
error: error validating "web.yaml": error validating data: failed to download openapi: Get "http://localhost:8080/openapi/v2?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused; if you choose to ignore these errors, turn validation off with --validate=false
Before sending anything, apply validates the YAML against the cluster's OpenAPI schema: the cluster's own list of which fields each kind of object allows. It has to download that from the API server, and there isn't one.
Don't take the suggestion at the end. --validate=false sounds like a fix, but it only moves the failure one step later: apply still has to send the Deployment to a cluster. On a real cluster, it would also hide genuine mistakes in your YAML. The cause is the same as before, and localhost:8080 gives it away: no kubeconfig, no cluster. When an error suggests a workaround, find the cause first.
Three details in that output are worth noticing:
- The container is named
nginx, after the image, notweb, after the Deployment. Tasks that ask you to change "the container's image" need that name:k set image deploy/web nginx=nginx:1.28. strategy: {},resources: {}andstatus: {}are empty. They're harmless. Leave them, or delete them if they clutter the file.replicas: 1is the default. Mostk createcommands take flags, like--replicas=3, so you edit less.
The other shortcut, $now, works the same way and stands for --force --grace-period 0. Normally a deleted pod gets about 30 seconds to shut down cleanly. k delete pod web $now skips that wait. Use it in the exam, where a pod you're replacing doesn't need a clean shutdown. Don't make it a habit on real clusters, where that 30 seconds is the app finishing its work.
On exam day
- Run the task's setup command first, every task. If a task gives a command to pick its cluster or machine, like
kubectl config use-context NAMEor ansshcommand, copy it and run it before anything else. Work done on the wrong cluster isn't the task. - Read the whole task before typing, including the namespace. When a task names one, a resource in
defaultisn't what it asked for. - Skip what you're stuck on. If tasks show their weight, use it to decide. Do the quick ones, flag the hard ones, and come back.
- Check your work:
k getwhat you made, andk describeit if anything looks off. A typo in a label means the task isn't done. - Use the docs for long YAML. Network Policies, affinity rules and PersistentVolumes are meant to be copied from the documentation's examples and edited, not typed from memory.
Clean up
Nothing to delete: you'll use these machines in every lesson. When you're done for the day:
(Your machine)
exit
vagrant halt
exit: leavescp1.vagrant halt: shuts the three machines down, keeping everything on them.vagrant upstarts them again in about a minute, without running the setup again.
In real life
- Pin versions on real clusters too, as
node-setup.shdoes withapt-mark hold. An unplanned Kubernetes upgrade, from an ordinaryapt upgradeon a node, is a real way to break a cluster. - Managed services do this setup for you. Amazon EKS, Azure AKS and Google GKE prepare the nodes, so you may never run
node-setup.shat work. The CKA still expects you to understand it, because when a managed node breaks, these are the parts that broke. --dry-run=serveris the safer check on a real cluster: the cluster validates the object, including its admission rules, without saving it.
Spot the problem
Work out what's wrong before you read the explanation.
"The cluster is down." You SSH to a control plane node to check something, and run kubectl get pods. It says The connection to the server localhost:8080 was refused. Your teammate's instinct is to restart the API server. What's really going on? The cluster is probably fine. kubectl on that node, for that user, has no kubeconfig, so it's trying the fallback address localhost:8080. A broken API server gives a different error: the real address, usually ending in :6443, and "connection refused" or a timeout. Here, either go back to the machine you were working from, or point kubectl at the admin kubeconfig: export KUBECONFIG=/etc/kubernetes/admin.conf (as root). Read the address in the error before you fix anything.
"My alias works, but Tab doesn't." Someone adds alias k=kubectl and source <(kubectl completion bash) to their .bashrc. kubectl get po then Tab completes to pods, but k get po then Tab does nothing. What's missing? The completion was set up for the word kubectl, not for the alias. Bash completes each command by its own name, so k needs its own line: complete -o default -F __start_kubectl k. __start_kubectl is the completion function that kubectl completion bash defines; this line tells Bash to use the same one for k.
Keep this
| To | Use |
|---|---|
| Type less | alias k=kubectl |
| Tab completion for kubectl and k | source <(kubectl completion bash), then complete -o default -F __start_kubectl k |
| Generate YAML instead of writing it | export do="--dry-run=client -o yaml", then k create ... $do > file.yaml |
| Delete without waiting | export now="--force --grace-period 0", then k delete pod NAME $now |
| Safe YAML in Vim | set tabstop=2 shiftwidth=2 expandtab in ~/.vimrc |
| Check what a name is | type k |
| kubectl's version, without a cluster | k version --client |
See localhost:8080 in an error | kubectl has no kubeconfig here: wrong machine or user, or use KUBECONFIG=/etc/kubernetes/admin.conf |
| Before every task | The task's own setup command, such as kubectl config use-context NAME |
Where you are now
You know what the curriculum covers and how its score is weighted, you have three practice machines ready to become a cluster, and your terminal is set up the way you'll use it in the exam. You've seen that --dry-run=client writes correct YAML with no cluster at all, so you'll rarely write YAML from scratch. Lesson 2 turns the three machines into a working cluster with kubeadm.
Check yourself
You have 10 hours of study time left. Your two weakest areas are storage and troubleshooting. Going by the exam's weights, which should get most of those hours?
With no cluster running at all, you run k create deploy web --image=nginx $do > web.yaml. What ends up in web.yaml?
kubectl get po then Tab completes to pods, and k get po runs fine. But k get po then Tab does nothing. Which .bashrc line is missing?
kubectl apply rejects a file you just edited in Vim with a YAML parse error, although the indentation looks right. What's the likely cause?
You paste vagrant ssh cp1 and five more commands as one block. After you later type exit, you see Password: and a zsh error. What happened?
An exam task starts with kubectl config use-context k8s-c2. You skip it, fix the problem, and your check shows it fixed. Why might the task still score zero?
Key terms
- CKA (Certified Kubernetes Administrator): a two-hour, hands-on Kubernetes exam from the Linux Foundation and CNCF.
- Domain: one of the exam's five subject areas, each worth a fixed share of the score.
- Control plane: the parts of Kubernetes that make decisions and store the cluster's state: the API server, scheduler, controller manager and etcd.
- Worker node: a machine that runs your apps' pods.
- kubelet: the agent on every node that starts and watches its pods.
- Container runtime: the program that actually runs containers; here, containerd.
- cgroups (control groups): the Linux feature that limits and measures a process's CPU and memory.
- Client-side dry run:
--dry-run=client, kubectl working out an object without contacting any cluster. - kubeconfig: the file, usually
~/.kube/config, that tells kubectl which clusters exist and how to log in to them. - Context: a kubectl setting that says which cluster, and which user, commands go to.
Go deeper
- The official CKA page (opens in a new tab), and the curriculum and handbook it links to.
- The Kubernetes documentation's kubectl quick reference (opens in a new tab), which includes the completion setup.
- Installing kubeadm (opens in a new tab), the page
node-setup.shfollows. - Killercoda (opens in a new tab)'s free CKA scenarios, for practice in a browser between lessons.