· Tutorial · 5 min read

How to pass the CKAD, CKA & CKS exams in a month

I just completed the CKAD, CKA & CKS exams in a little over a month. Here are my tips & tricks to do the same 🏅

I successfully completed the Kubernetes exams in a little over a month 🥳

Here are the official badges issued by The Linux Foundation on Credly :

CKAD, CKA and CKS badges issued by The Linux Foundation — the three Kubernetes certifications, passed in one month

Learning Path

The CKAD, CKA & CKS are two-hour hands-on exams in a PSI Secure Browser. You have one year to pass the exam after purchase. You can easily find a coupon code on the internet for some discount.

Courses

Here are the courses I recommend for the exams :

Killer.sh > 75

You will have 2 free sessions on killer.sh, which is quite similar to the PSI Secure Browser. Each one available for 36 hours, but both have the same questions. If you get a score of 75 or more, you should be fine for the exam.

PSI-like exam UI

Know how to verify

Being able to verify your answers is a really good exercise during the training phase. For instance, if they ask you to deny all traffic from a pod, you can check it using :

Terminal window
kubectl -n sandbox exec shell -- curl -s google.com

kubectl explain

At the exam, you will have access to the kubernetes official documentation, but if you need to search in it for every question, you will lose too much time… So being familiar with the doc to quickly find a YAML sample for a PersistentVolume is nice, but for the rest, kubectl explain is your best tool !

Terminal window
# Get the documentation of the resource and its fields
kubectl explain pods
# Get the documentation of a specific field of a resource
kubectl explain pods.spec.containers
# Get all the fields in the resource
kubectl explain pods --recursive
# Browse the documentation
kubectl explain pods --recursive | less

kubectl run, create, edit, scale, expose

You can solve most of the questions without writing any YAML, if you know the tricks 😉 The worst case would be to type a command, dump the YAML into a file, then edit & apply. Here are some examples :

Terminal window
# Create a nignx pod ...
kubectl run nginx --image=nginx
# ... and dump it to a yaml file for some customization
kubectl run nginx --image=nginx --dry-run=client -o yaml > pod.yaml
# Create a deployment
kubectl create deployment nginx --image=nginx
# Scale it to 3 pods
kubectl scale --replicas=3 deployment/nginx
# Expose deployment
kubectl expose deployment nginx --port=80 --target-port=8000
# Change ClusterIP to NodePort with edit
kubectl edit svc nginx

Set context & namespace

Each question is bound to a particular context & namespace. Use kubectl config set-context ... at the beginning of each question to be sure where you are. They will provide the command, you just have to copy-paste it !

Flag & Skip

You must have 66% or above to obtain the certification. So it’s better to flag & skip a question, instead of losing 15 minutes on it ! You can go back on it later ⏱️ Normally, you will be able to answer 75% of the questions in less than 5 minutes, so keep the 1 or 2 hard ones for the end…

Backup files

You should back up any file they provide, in case you want to restore it, like any seasoned Ops 🧙🏻‍♂️

Terminal window
cp /some-dir/file.yaml /some-dir/file.yaml.ori

Minikube or some VMs in the cloud

For CKAD, Minikube is your perfect training environment. On the other hand, I strongly recommend you to use some VMs on AWS, GCP or Azure for the CKA & CKS. Some people could argue that you can do it using Vagrant or Minikube, but it will add an unnecessary level of abstraction…

Killer.sh provides a good k8s cluster setup example.

On my side, I automated the whole thing with Ansible in vspiewak/k8s-playground : a kubeadm cluster on AWS EC2, and my notes for each CKS topic. The package versions are pinned slightly outdated on purpose, so you can practice a cluster upgrade on it 🔧

Vim tips

Vim will be your only editor available. So be comfortable to use it. There are plenty of Vim beginner guides on the internet if you need to.

One particularly useful Vim trick for the exam is to visually select a YAML block and indent it. You can easily do it with :

  • shift + V to select some lines
  • > or < to indent them more or less
  • . to repeat

TL;DR

The Kubernetes certification exams don’t contain any big surprises if you have studied & trained enough. Don’t stress too much, and keep in mind you need to achieve 66% with one free retake 🍀

Share:

Related Posts

View All Posts »