Passing CKAD — tips & tricks
I recently took the Certified Kubernetes Application Developer (CKAD) exam conducted by the Cloud Native Computing Foundation (CNCF) and Linux Foundation. This post covers some of the recommendations based on my experience.
This is a remotely proctored exam which consists of 19 practical tasks to be completed within 2 hours, where you are expected to perform these tasks on specified Kubernetes clusters. You can refer to official Kubernetes documentation. You need to get 66% to pass. If you have been working with Kubernetes as part of your day job, you are going to find the exam quite easy. Nevertheless, efficient time management in order to complete the tasks within the given time could still be a challenge.
Curriculum
Recommended Resources
The following 3 resources are all what you would need to pass the exam as well as get good working knowledge of Kubernetes.
KodeKloud CKAD Udemy course
This is by far the best course on CKAD out there. I would highly recommend it to anyone who wants to sit for the CKAD exam, or learn the fundamentals of Kubernetes. The course covers more than what is required for the exam and will help you in real world Kubernetes projects as well.
CKAD Crash Course
A very good resource which contains questions similar to ones you would get in the exam, along with solutions.
CKAD Exercises
Another good resource that provides exam-like questions and answers.
Before the Exam
The proctor will start a chat with you and you will need to start your camera & microphone and also share the desktop. Remember that you will not hear or be able to see the proctor, but can only use the chat window to interact with them.
All application windows except the Chrome browser would have to be closed and apart from the exam tab, you can only open one more tab to refer to official Kubernetes documentation.
The proctor would ask you to hold up your identification (valid passport bio page with your signature, valid driver’s license with signature etc.) to the camera, and then ask you to slowly pan the camera around the room where you will be taking the exam. There should be no charts or writings on the walls and the desk should be clear of everything except drinking water in a clear container. You will even have to show the space under your desk. So it is advisable to prepare your room well in advance. There shouldn’t be unnecessary noise during the exam and you are not supposed to look away for too long from your monitor or unnecessarily move your lips or speak. Your face and torso should be visible to the proctor at all times.
Once the proctor is satisfied, you may click the start exam button.
During the Exam
User interface
This is how the user interface would look like
Very first step
Enable kubectl autocomplete.This would save you a lot of time https://kubernetes.io/docs/reference/kubectl/cheatsheet/
Read the questions carefully. Pay attention to the cluster and namespace
Take your time to carefully read the question and make sure that you provide the solution in correct cluster and namespace. Make sure that all aspects of the task have been addressed.
“kubectl explain” is a lifesaver
For example, k explain pod.spec — recursive | less or k explain pod.spec.containers.livenessProbe
Use this liberally when creating/fixing/editing configuration.
vim basics
Knowing some vim basics will help you save time
:<line-number> — go to line
/<text> — find text
<n>yy — copy n number of lines from cursor. Just yy to copy a single line
p — paste copied lines
G — go to end of file
gg — go to start of file
x — delete character
<n>dd — delete n nmber of lines. Just dd to delete a single line
tmux
Splitting the screen so that you could edit Kubernetes configs in one pane while viewing output from ‘kubectl explain’ is going to save you loads of time.
You don’t have to master tmux, but just need to know a few shortcuts.
Simply startup tmux in the terminal by running the tmux command. CTRL+b and then % to vertically split the terminal. CTRL+b and then o to switch between the panes. These are the only shortcuts you need to know.
Always backup resource definitions before you delete them.
This is always a best practice when you are working with Kubernetes clusters. In case you make a mistake, you could always restore using the backup files.
For example,
k get po foo -oyaml > foo-pod.yaml
cp foo-pod.yaml foo-pod.yaml.orig
k delete po foo
# edit foo-pod.yaml
k apply -f foo-pod.yaml
Imperative commands
Use kubectl imperative commands as much as possible. Avoid creating yaml files from scratch as much as possible. — dry-run=client -oyaml > outfile.yaml is going to be your friend!
Disable auto-indentation in vi while pasting
Auto indent is enabled by default in vi in the exam setup. When you copy and paste YAML segments, this could cause weirdly formatted config which could be a real pain during the exam where every second matters. In order to avoid this, turn off auto indent when you paste code. There’s a special “paste” mode.
Type
:set paste
Then paste your code. Note that the text in the tooltip now says -- INSERT (paste) --
.
After pasting, turn off the paste-mode, so that auto-indenting when you type works correctly again.
:set nopaste
Make sure that you are in the correct cluster & namespace
4 clusters are provisioned for your exam, and each question provides the command to switch to the correct cluster. Make sure you copy paste and run that command before each question to make sure that you don’t waste time carrying out the specified task in the wrong cluster. You also need to be mindful of the namespace the solution has to provided in. The question clearly states it. If the namespace is not specified, then you need to provide the solution in the default namespace.
Mark questions to revisit later
You have the option to mark a question to revisit it later in case you have some doubts or issues. Do not get stuck in a question and spend a disproportionately long time on it but mark it and revisit it later.
Ending the exam
The proctor would inform you the time left 10 minutes before the your time would be up. At the end of the exam, you would be asked to click the end exam option. A few minutes later you would get an email informing you that the results would be made available within 36 hours.
Results
The exam results would be made available within 36 hours of completing the exam. In the unlikely event of failing the exam, you would get one more free attempt.