Alica's dev blog
Tips and tricks for passing CKAD exam (after September 2021 curriculum update)

In October 2021, I successfully passed Certified Kubernetes Application Developer (CKAD) exam. That was after quite significant changes in the exam curriculum that happened on September 28, 2021 (you can compare the current and the previous version).

I scored 89% – given that you need to score 66% to get the certificate, I consider that quite good :-)

In this article, I will share tips that I compiled from other articles I read before the exam, plus add some based on my own experience.

About the exam in general

The most important thing is that the exam requires you to be able to perform practical tasks - there are no theoretical questions. You may find more information on the official webpage.

Changes in the curriculum

First, a personal story:

On a nice Friday afternoon on September 24, 2021, I was doing some practice exercises. I felt like I already had all the required knowledge and trained mostly for speed. I went to check with the curriculum if I really covered all the areas, and boom! – I discovered that the exam content was to be changed from September 28. I was supposed to spend the next 4 days on a trip abroad, so a last-time registration for the exam before the 28th was not an option. That nice afternoon suddenly became less nice.

Linux Foundation is not obliged to inform you about any changes in the programme. They announced the curriculum changes on their website in July 2021 (that was after I bought the exam) and I didn’t receive any notification. Therefore I recommend you to check their website once in a while.

And what about the actual content of the curriculum?

Honestly, I believe that now it is more relevant and actually makes more sense. It talks more about the skills the candidate should possess and less about the names of Kubernetes resources they should understand (see the current and the previous version for comparison).

On the other hand, if you want to use it as a guidance on what exactly to study, it provides less information now. But even before, it wasn’t very detailed.

Scoring

Each task has different weight. The FAQ doesn’t clearly say whether you can get partial credit for a task, but I assume you can (and I am not the only one who thinks so).

If I remember correctly, ll my tasks had even weights, but my score was 89% – so I must have gotten an odd partial score for at least one task.

Preparation

One general tip: When you start the preparation, just don’t stop! Do at least a couple of short exercises at least once week. I was already quite comfortable with all the concepts and kubectl commands when I went for a 3-week vacation where I barely turned on my laptop. After I came back, I felt like half of the things evaporated from my mind.

Study materials

I purchased a Udemy course by Mumshad Mannambeth and strongly recommend it. It cost me 12.99€ (it seems to me that Udemy courses are on sale 90% of the time) and it was definitely money well spent.

This course has everything you need:

  • videos with explanations of every concept from the curriculum (also includes new topics from the new curriculum)
  • access to environment with practice exercises for all the topics

I am not saying that there are no other great courses, actually I am sure there are – I picked this one more or less randomly. However, I believe that you don’t need them all – you need to pick just one. For me, this course was sufficient.

And of course, you should definitely become familiar with the documentation. I didn’t read everything about every resource, but I knew how to quickly find what I needed. (Only later that I discovered that I can use bookmarks during the exam – see the section dedicated to bookmarks.)

The API reference is useful to find the name of a particular attribute. For example, you want to create a job that fails after 4 unsuccessful attempts. How is that attribute called? (The answer is backoffLimit.)

I recommend skimming through the kubectl reference, especially the parts about kubectl run and kubectl create – you will find what resource with which attributes can be created imperatively, which may save you from some typing or copy-pasting.

Practice exercises

Apart from the exercises from the Udemy course mentioned above (I went through them twice), I also went through the exercises from this repo because multiple articles recommended them. However, as of October 2021, they don’t reflect the changes in the curriculum and therefore don’t cover all the topics that you should practice. Still, they might be useful for the topics that didn’t change.

And where to practice? I used Kubernetes Playground on Katacoda. The terminal there is far from perfect – the autocompletion doesn’t work with the k alias (or any other mentioned below)) and typing multi-line commands is a pain – but it spares you from doing any local setup.

Note: During the whole time of my preparation, it worked without logging in, but now it requires me to log in to access it. Not sure if it’s just me or they won’t allow anyone to use it without login.

Exam simulator

Everyone who purchases the exam also gets access to the exam simulator. You can also access the simulator without purchasing the exam, but it will cost you 29.99€ + VAT.

The advantage of the simulator is that the environment is very similar to the actual exam environment (more on that below).

Don’t just play with the simulator. Imagine that it is the actual exam: reserve 2 hours of uninterrupted time, open one tab with the documentation, set up the aliases and try to solve as many tasks as possible.

Time management and shortcuts

Every article will tell you that speed is important – and training for speed is an important part of the preparation. You should learn how to use imperative commands to generate yaml manifests when possible. You should also utilize some useful shortcuts – see below.

Some people say that they didn’t even manage to finish all tasks within the time limit (2 hours). Therefore I was very surprised that I managed to finish everything in ~90 minutes and could spend 30 minutes on checking my answers!

There are multiple possible explanations:

  1. I possess some magical abilites. (unlikely)
  2. The exam has been adjusted so that you can finish everything in time if you have a reasonable level of understanding of the key concepts.
  3. If you practice enough, you become so proficient that even if you make mistakes here and there, you still have enough time to finish all the tasks.

Aliases

You will find the most important alias, k for kubectl, already pre-configured in the exam environment.

I believe that the second important – which you should definitely use – is the one to change the namespace of the current context:

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

Therefore, if you should perform the task in example namespace, then instead of appending -n example to every command or writing the above command, you just write kn example.

You can also find the following aliases useful:

alias kaf='kubectl apply -f'
alias kg='kubectl get'
alias kd='kubectl describe'
alias kc='kubectl create'

# runs a debug pod that you can use e.g. to test services with wget
alias kdbg='kubectl run debug --image=busybox --rm -it -- sh'

Once you have set up the aliases, I recommend you to print them on the console (using alias command) and copy them to the notepad. In case your session is restarted (happened to me after I lost the connection for a very short moment), you will need to set them up again.

Variables

I also found it quite useful to set the following variable:

export dy="--dry-run=client -o yaml"

It saves time to create resources imperatively, but sometimes you first need their yaml manifests to edit some properties and only then create them.

For example, you want to create a pod my-pod with busybox image that runs command echo hello in a container named my-container. If you just use kubectl run to create a pod named my-pod, its container will be called my-pod as well, so you need to first generate the yaml like this:

k run my-pod --image=busybox $dy > my-pod.yaml -- sh -c "echo hello"

Other shortcuts or useful commands

All namespaces

Another useful shortcut which is hidden in Formatting output section of kubectl cheatsheet is -A which means the same as --all-namespaces. It can save you 14 keyboard presses!

If you need to get all pods in all namespaces, you simply type

kubectl get po -A

or just

kg po -A

if you make use of kg alias defined above and po short name for pods.

Short names of resources

You can get the list of all resources with their short names by running the command

kubectl api-resources

Connecting to a pod or a service

To test a connectivity to a pod or service, use the “debug” pod (see kdbg alias):

kdbg wget -qO- [address]

Using grep

When you use kubectl get -o yaml or kubectl describe to get detailed information about the resource, the output can be quite long. If you need to quickly find one piece of information, grep is your friend.

For example, if you want to find the name of the image that pod test-pod uses, you type

kubectl describe po test-pod | grep -i image

and the output will be something like

    Image:          nginx
    Image ID:       docker.io/library/nginx@sha256:644a70516a26004c97d0d85c7fe1d0c3a67ea8ab7ddf4aff193d9f301670cf36

Useful flags:

  • -i makes the search case-insensitive
  • -A 3 prints the lines with the searched term plus 3 lines after
  • -B 3 prints the lines with the searched term plus 3 lines before
  • -C 3 prints the lines with the searched term plus 3 lines after and 3 lines before

Editor

The default editor is set to vim. I understand that it is a very powerful editor, however, I decided not to learn about its capabilites during the exam preparation – and I used nano instead.

You don’t need to care about the default editor when you are working with existing files – you just open it with whatever editor you want. However, if you want to edit an existing resource via kubectl edit command, its manifest will be opened in the default editor.

Using nano

To change the default editor to nano, run

export KUBE_EDITOR=nano

In case you forget to do it, at least try to remember that you can exit vim by typing :q.

I also set the following configuration in ~/.nanorc file:

set tabstospaces
set tabsize 2 # or 4, or whatever

Setting tabs to be saved as spaces is important – if your yaml manifest contains tabs, kubectl will complain that it is invalid.

Setting the size of the tab is just a matter of preference.

On the other hand, I don’t recommend

set autoindent # if you copy yaml from the docs, its indentation will get f***ed :-(
set linenumbers # if you copy something, the line numbers will be copied as well :-(

Bookmarks

As you can have only one additional browser tab with documentation open during the exam, bookmarks can save you a lot of time!

Currently, Chrome is used to access the exam environment, so you can prepare your bookmarks there (you might also use my collection of bookmarks). However, there is a plan to migrate to a new proctoring platform which won’t allow you to use any bookmarks. As of October 2021, the dates for the migration are not announced yet.

On the day of the exam

Exam user interface

There is an official screenshot of how the exam environment looks like.

The terminal was responsive and keyboard shortcuts for copy and paste worked for me without any problem. Also the autocompletion worked well.

Correct cluster and namespace

At the beginning of every task, there is a command that you must use to switch to the right cluster. Although the tasks on the same cluster appear consecutively, I still ran the command on every question to make sure I worked in the correct cluster.

It is your responsibility to use the right namespace. Some of the articles I read complained that the names of the namespaces often seemed like random strings and you had to read the whole question to find out which namespace you should use.

I don’t know whether the change came with the new curriculum or earlier, but it seemed to me that this is not a case anymore.

If the task should be performed in other than the default namespace, then the name of that namespace was written at the beginning of the task (together with cluster name). Also the names of the namespaces were mostly normal words.

Flagging

Strangely, the flagging of the tasks didn’t work for me. I asked the proctor about it, but they weren’t able to answer this type of question. Fortunately, I had enough time to go through all the tasks again – but if somebody is under bigger time pressure, they might lose precious time by searching for the questions they skipped before.

You might consider using the notepad to write down numbers of the tasks you need to get back to.

Webcam

According to the FAQ, you need the webcam that is capable of being moved. I even got an external camera just for this exam after I saw a video from the proctoring partner, just to be sure that everything will be all right.

Funnily, I ended up using my laptop camera because I couldn’t find the right distance from the external webcam when holding my ID - the proctor just couldn’t read it. They asked me to use laptop camera instead and could read my ID without any problems (I have Macbook Air 2020). I needed to restart Chrome in order to use the laptop camera instead of the external one.

Conclusion

I hope you find the tips useful. They might save you some time during the preparation and during the exam. Still, the most important thing is to practice – only practice will successfully get you through the exam!


Last modified on 2021-10-29