How to prepare for the Kubernetes CKAD exam

In this post, I will share my own experience on How I prepared and managed to pass the Certified Kubernetes Application Developer. and Will show What it takes to pass the exam from my own point of view.

I got a %94 score, although I thought I won’t make it from the first try 😀

I will divide the post into 3 sections:

  1. How did I prepare
  2. Tips and Tricks for the exam
  3. My thoughts on the exam

First, I want to thank my mentor Rashad Saif who always guided and inspired me to go and tackle such an exam.

How did I prepare for the exam


First, I attended the LinuxAcademy training about 2 or 3 months back and practiced every single Hands-on lab as part of the training.

However, If I go with this training alone, I think I couldn't make it and pass. And this is because the trainer is a hardcore one, as he keeps writing every single Kubernetes object as YAML by hand, and IMHO the exam won’t need that skill, and if you have done so, you will find yourself run out-of-time.

For the sake of exam limited time (2 hours, but still not enough), you need to generate as much YAML as you can (using the imperative commands) and to do copy-and-paste from the docs.

The second course I attended, was the last week, and it was from O'Reilly by Benjamin Muschko, and I did practice every single Demo in the course.

I learned from this course how to be lazy and do copy-and-paste from the documentation about everything I need. and I think this is a very important skill to have to be able to finish the exam on time.

When I attended the first course from Linux Academy, I learned I need to remember every single YAML file and I had a very bad time trying to remember the YAML syntax for Job, CronJob, etc.

But After I attended the O'Reilly course, I learned that I don’t have to remember such many details, and I either need to generate YAML (using imperative commands run and create) or just go to docs and copy and paste as quickly as I can. (I will talk about this one in the tips and tricks section)

I am not saying that the LinuxAcademy course is bad, it is good, actually very good, but you need to learn to be lazy and not to write every single YAML file by hand.

Practice: 🚀🚀🚀

The second preparation I have done after attending the previous courses is to practice by hand.

  1. Based on Advice from Rashad (mentioned above), I went through the great repo and solved every single challenge there, and validated my solution against theirs, and I learned some new tricks.
  2. I went back to the LinuxAcademy Hands-on lab and solved them again (remember I solved them the first time 2 or 3 months back), so I had to solve again, and I learned something new.

After I did so, I applied for the exam immediately while the information is still fresh in my mind.

Tips and Tricks for the exam

bookmark important pages from the docs

I will list tips and tricks as points so you can easily follow:

Remember, there will no be much time for you, so keep concentrated, solve the question and try to verify it ASAP and move to the next.

1. Bookmark the most important pages from the documentation so you can easily go back to (Advice from Rashad Saif)
And not only do bookmarking, but familiarize yourself with its content as I show in the previous section.

I find that, If you try to solve the exercises I mentioned above on your own, you will get familiar with the docs.

2. Get used to using bad and web-based terminals.
I used Linux Academy hands-on lab browser ssh sessions or vai chrome ssh extension (although the terminal provided in the exam was not that bad)

I used iTerm on mac as well, but the point is to use web terminals sometimes to familiarize yourself with its not-so-good experience.

3. Practice on the same version as the version of the exam.
This is very important because LinuxAcadmey and GCP (which I tried) -as the time of writing — doesn’t provide k8s 1.18 and the exam was targetting 1.18, and it is very important as a couple of run options regarding creating jobs and deployments are no longer valid.

You can use the following article to install k8s 1.18 in minutes in your local machine.

4. Arm your self with quick shortcuts for the terminal, tmux, and VIM.

I never used tmux before, but I prepared my self to use it, so I learned very basic usage, how to start tmux session, how to open two panes (horizontal or vertical), and how to exit.
Fortentully, I don’t have to use it in the exam.

However, you can configure kubectl to use nano, I find vim is simple and has very good shortcuts, like:

o means start to write in the next line
shift + o means start to write in the previous line (didn’t use a lot)
<n> + >> shift the number of lines to the right (handful when copy docs)
<n> + << shift the number of lines to the left
<n> + yy copy the following number of lines
<n> + dd delete the following number of lines
p paste the copied or deleted lines

<n> above means a number, like 2 or 3, and represents the number for lines to act on.

It is good to know how to move around the terminal line quicky using different shortcuts

If I recommend a single shortcut to memorize, the (ctrl + R) is your mate here.

5. Use the root user in the exam
It is very important as you will have to write to permission-protected files.
So, I highly recommend that the first command to write on the terminal of the exam is to be:

sudo -i

6. Skip long questions with a low impact on the score

Sometimes you will find a very long question that scores as 2% or 3% from the exam, and one very short question that scores 10% or more. Skip the long question and record it in the notepad.

People keep saying to use the Notepad function to keep the number of the question you skipped in the format:

<question number> <topic> <percent>

7. Setup bashrc and vimrc properly

Add the following to .bashrc (remember you are modifying the /root/.bashrc )

alias k=kubectl
source <(k completion bash | sed s/kubectl/k/g)
export r='--restart=Never'
export d='--dry-run=client -oyaml'

The last 2 lines are very important and save some writing, so to check the Generated YAML before executing, just append $d your the command, example:

k run busybox --image=busybox $r $d -- /bin/bash -c 'sleep 3000'

This will print the pod definition.

Add the following to .vimrc (remember you are modifying the /root/.vimrc):

set expandtab
set shiftwidth=2
set nu
syntax on
set tabstop=2

expandtab and shiftwidth very important when you copy text from the documentation and will help you a lot when you do indention using vim << command (see above)

My thoughts on the exam

I hope the information I provided the previous sections to help you prepare for the exam. In this short section, I will share my thoughts.

If you solve the exercises I mentioned above, you will find the exam is easier than the exercises. (That is my experience at least)

I find the exam enforces you on how to be fast on creating, debugging, and solving Kubernetes running issues. but it doesn’t concentrate on the idea behind it. however, the Kubernetes documentation does.

For example, It doesn't ask you about the k8s patterns and when to use what. It asks you to go and implement some patterns and give you almost all the steps required to do.

I hope there will be a multiple-choice section that examines your knowledge about the k8s from the architecture/design point of view; To ask you about the What not only the How.

Thanks and I hope this will help you tackle your CKAD exam.

Software Developer/Architect