Skip to main content
Certification

What a Hands-On CKA Mock Exam Looks Like: 16 Tasks in a Real Cluster

By Coder in 907 min read

The CKA exam is not multiple choice. You get a terminal, a set of clusters and a clock, and you fix and build things until the time runs out. A question bank can tell you whether you recognise the right kubectl flag. It cannot tell you whether you can fix a cluster you have never seen, with 40 minutes left and six tasks to go.

That gap is why we built the coderin90 Exam Simulator for the CKA exam as a hands-on mock exam in a real cluster. This post shows what one looks like from the inside: the layout, the scoring, and two of its 16 tasks worked through. The other 14 stay unpublished, so the exam is still worth taking.

A note before we start: this is a practice exam written by coderin90 to the published curriculum. It is not the real exam, and it is not affiliated with or endorsed by The Linux Foundation.

The shape of the mock exam

  • 16 tasks, 120 minutes. Each task counts the same, and your score is the tasks you passed out of 16. The real exam may weight tasks differently and give part marks; its pass mark is 66%. Treat our score as a guide, not a prediction.
  • Three hosts. Your terminal opens on controlplane. Every task names the host it runs on, and you ssh node01 or ssh node02, do the work, then exit back. kubectl and helm work on every host.
  • The same docs as the exam. kubernetes.io/docs, kubernetes.io/blog, helm.sh/docs and gateway-api.sigs.k8s.io. Nothing else.
  • Independent tasks. Each task has its own namespace or names, so getting stuck on one does not break another. Skip what stalls you and come back.
  • One check per task, run once. You press Check when you are done, and every task is checked against the cluster’s real state. The first check run is your score, so let your rollouts finish first.

The 16 tasks spread across the five curriculum domains roughly in proportion to their published weights:

Domain Weight in the curriculum Tasks in the mock
Troubleshooting 30% 5
Cluster Architecture, Installation and Configuration 25% 4
Services and Networking 20% 3
Workloads and Scheduling 15% 2
Storage 10% 2

Expect tasks from every domain in the table. Below are two of them in full. The names are changed from the exam itself.

Worked task 1: a CronJob with a trap (Workloads and Scheduling)

In namespace stats, create a CronJob digest. It runs every 5 minutes, with image nginx:1.27 and the command date. Keep 2 successful jobs. A job must be stopped after 30 seconds. Then create a Job digest-now from the CronJob and let it complete.

The fast path is imperative. kubectl create cronjob takes the schedule, the image and the command:

kubectl -n stats create cronjob digest --image=nginx:1.27 \
  --schedule='*/5 * * * *' -- date

That gets you most of the way, and it is where people lose the point. The task asks for two things create cronjob does not set:

  • Keep 2 successful jobs. The default for successfulJobsHistoryLimit is 3. Leave it and the check fails, even though the CronJob looks fine in kubectl get.
  • Stop a job after 30 seconds. That is activeDeadlineSeconds, and it belongs on the Job template (spec.jobTemplate.spec), not on the CronJob’s own spec.

One merge patch sets both:

kubectl -n stats patch cronjob digest --type=merge -p \
  '{"spec":{"successfulJobsHistoryLimit":2,"jobTemplate":{"spec":{"activeDeadlineSeconds":30}}}}'

Then the Job, created from the CronJob so it inherits the template you just fixed:

kubectl -n stats create job digest-now --from=cronjob/digest
kubectl -n stats get jobs -w

Order matters here. Create the Job before the patch and it carries the old template, which a stricter grader, or the real exam, could fail. The check reads the schedule, the history limit, the deadline, the image, and whether a Job owned by the CronJob has succeeded, so all five have to be right for the task to pass.

What it tests: that you read every clause of the task, and that you know which defaults kubectl create fills in for you.

Worked task 2: a claim that stays Pending (Storage)

ssh node01. In namespace archive, the PersistentVolumeClaim archive-data stays Pending, so the pod archive never starts. Make archive-data bind to the PersistentVolume archive-pv and get archive running. Do not change archive-pv.

Start by comparing what the claim asks for with what the volume offers:

ssh node01
kubectl -n archive describe pvc archive-data
kubectl get pv archive-pv -o jsonpath='{.spec.accessModes} {.spec.capacity.storage}{"\n"}'

The claim asks for ReadWriteMany. The volume offers ReadWriteOnce. A claim only binds to a volume that offers every access mode it asks for, and the task forbids changing the volume, so the claim has to change.

Here is the catch: a claim’s access modes cannot be edited in place. kubectl edit will refuse the change. You have to recreate the claim, and it is cleanest to recreate the pod that names it too:

kubectl -n archive get pvc archive-data -o yaml > pvc.yaml
kubectl -n archive get pod archive -o yaml > pod.yaml

In pvc.yaml, change ReadWriteMany to ReadWriteOnce. In both files, delete status and the server-set metadata (uid, resourceVersion, creationTimestamp), so the API server accepts them as new objects. Then:

kubectl -n archive delete pod archive
kubectl -n archive delete pvc archive-data
kubectl apply -f pvc.yaml -f pod.yaml
kubectl -n archive get pvc,pod
exit

The check wants the claim Bound to archive-pv, the pod Running, and the volume still ReadWriteOnce with its original size. Solving it by editing the volume fails the last part, which is the point of the “do not change” clause.

What it tests: reading describe output for the real cause, knowing which fields are immutable, and keeping your hands off what the task says to leave alone.

What you see when you finish

You see the list of 16 checks and which of them passed. Each check is named after its task, so a failed one tells you where to look on your next attempt; working out which detail you missed is part of the practice. Your score is the number passed out of 16.

Two habits the mock exam rewards, and the real one does too:

  1. Read the whole task before typing. Most lost points in the two tasks above come from a clause skipped, not from a command forgotten.
  2. Verify before moving on. kubectl get, describe and -w are cheap. A second look costs ten seconds; a missed task costs one sixteenth of your score.

Try it

The coderin90 Exam Simulator for the CKA exam starts with a free five-question quiz, one question for each domain, weighted the way the curriculum weights them, with no sign-up to see your score. If you want the full thing, it is one full mock exam, three attempts, each in its own real cluster, for a one-time $29, £25, C$39 or €29.


CKA, Certified Kubernetes Administrator and Kubernetes are trademarks of The Linux Foundation. coderin90 is not affiliated with or endorsed by The Linux Foundation.