How to sucessfully pass the CKAD exam

FrankFrank
3 min read

The Certified Kubernetes Application Developer (https://training.linuxfoundation.org/certification/certified-kubernetes-application-developer-ckad/) is a great certification to train and prove your Kubernetes skills. For approximately USD 600 you can get the course and exam. The exam is a 2 hours hands-on exercise where you can prove that you can deploy, scale and debug applications on Kubernetes. I took the exam in May 2022 and passed the first try. Here are a few tips that can help you.

Essential setup

Speed is essential. It is very important that if you can't write the commands on top of your head, you have a quick way of performing certain actions.

Take a minute or two to set up your environment properly before starting with the first question. Bookmark the Kubernetes cheat sheet and open the page as soon as the exam starts: https://kubernetes.io/docs/reference/kubectl/cheatsheet/. Copy and paste the following commands. Those three commands allow you to use the k alias for kubectl and have bash autocompletion activated for this alias. You can then type for example k get po a<tab> and it will autocomplete the pods name starting with a.

source <(kubectl completion bash)
alias k=kubectl
complete -F __start_kubectl k

I was reading a lot of articles where they suggested setting the following alias to quickly switch between different namespaces:

alias kn='kubectl config set-context --current --namespace'

I was always using this alias during the labs, but when the exam approached I realised that you sometimes need to save a command to a file. Since I was afraid the command couldn't just run as is, when I set the namespace permanently I decided to ditch the alias for the exam and always specify it explicitly.

Next set up your vim properly.

vim .vimrc

and add the following three lines:

set tabstop=2
set expandtab
set shiftwidth=2

With these set, you will be able to modify and add to the manifests without getting syntax errors because your YAML files are malformed.

Then set two more environment variables which will make your life much easier.

export now='--grace-period 0 --force'

You can use it to quickly delete a resource without waiting for Kubernetes for gracefully shut it down. For example: k delete po test $now. This will immediately terminate the pod and save you valuable time.

This next variable is maybe the most important one to set of all the tips above:

export do='--dry-run=client -o yaml'

You should use it anytime you want to create a manifest from the command line. So instead of doing

k run test-pod --image=nginx
k get po test-pod -o yaml > test-pod.yaml
k delete po test-pod $now

you can simply use the do variable to have a manifest:

k run test-pod --image=nginx $do

This will save you a huge amount of time.

Always use the command line and only check the docs if really needed

Try to use the command line to create resources whenever possible. You will be much faster using the CLI instead of searching the documentation. I think I pretty much completed the whole exam without using the documentation. Keep in mind that you can always use the -h flag to get useful examples.

Practise exams

I scheduled two practice exams from Killer Shell (https://killer.sh/) and found it very useful to practise for the real exam. The setup of the practice exams is very close to the real one and you can learn how you perform under time pressure. The practice exams are a bit harder than the real ones, so if you can get a good score in the practice exam you should be ready to rock the real one!

0
Subscribe to my newsletter

Read articles from Frank directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Frank
Frank