Practical tips for the CKAD v1.18 exam
In 2020, amidst the COVID-19 pandemic I decided to get a flavor of the upcoming, sexy and relatively new cloud technology called Kubernetes a.k.a. k8s (pronounced kate’s). I already admired the elegance of dockerizing applications but I could clearly see some of its limitations. Limitations which I was told could be gracefully solved with the aid of Kubernetes. For this reason, I decided to take on a ‘from zero to hero’ type of journey. I started preparing for the CKAD exam in mid-April from literally having zero Kubernetes knowledge to collecting my CKAD certificate in late June after my first attempt. The Kubernetes version examined at that time was 1.18.
There is already so much material out there if you want to educate yourself that it can be overwhelming. Personally, I found four resources that cover the CKAD curriculum adequately. These were:
- Kubernetes for Developers (LFD259) course by the Linux Foundation: very useful if you are a complete beginner or do not have any practical experience with k8s. It is a paid course, however, it introduces the whole CKAD curriculum in a structured fashion which can be quite helpful for a complete rookie like myself. If you already have some hands-on experience I would skip it.
- TechWorld with Nana Youtube videos: Nana’s videos are quite intuitive and to the point. Certain Kubernetes concepts which I found not superbly explained in the course above (quite a few I might add) were made easily understood by Nana. Big shout out to her.
- CKAD exercices of Dimitris Gkanatsios: Once I had a good grasp of the theoretical concepts of Kubernetes, these exercises became my best friend. It is paramount to solve them multiple times as they will give you the closest feeling to the exam tasks. Only when I was able to solve them really really fast I considered taking the exam. Highly recommended, they helped me enormously.
- Official Kubernetes documentation: What can be a better resource than the actual Kubernetes documentation!? I started using this resource as I was solving the exercises above. In addition, you will be able to access this resource in a single tab during the exam. Therefore make sure you know how to use well the in-site search engine.
I realized I was ready for the exam when just by reading a question from the CKAD exercises above, I knew immediately which of the below techniques:
- Using an imperative command
kubectl ... -dry-run=client -o yaml
- Checking the resource specification
kubectl explain <resource>.spec
- Copy-pasting YAML from the official Kubernetes documentation and knowing exactly which keywords to use in the in-site search engine to find what I need.
- Using the help flag
kubectl ... --helpwith the relative kubectl command which more often than not can show you several usage examples.
or which combination of them, could solve the task the fastest.
The actual examination was a bit more challenging than I expected. It is not a particularly difficult exam however due to the time limit of 2 hours and the in-browser shell environment which I was not accustomed to I definitely felt less comfortable and not as fast as I did when practicing on my own custom shell. Remember, the exam is 2 hours and it contains 19 problems thus you have 6.3 minutes per task. Every keystroke saved, counts. Below, I enlist some practical tips before taking and during the exam which I myself found particularly, well, very practical.
BEFORE THE EXAM:
Tip #0: If you use the bash/vim shortcut
Ctrl + woften while in terminal, I would highly recommend you to assign it in Chrome to do some custom plugin behavior by visiting
chrome://extensions/shortcuts. By default, pressing
Ctrl + win Chrome will close your current tab. I bet you do not want to find yourself in that situation during the exam.
Tip #1: Try to familiarize yourself with vim. Using the notepad during the exam will be cumbersome as it will hide your shell. Editing files straightly on vim can save you lots of time. Plus, vim is awesome!
Tip #2: Try to get comfortable in the examination environment shell. I remember, there was a link somewhere within the Candidate Handbook.
DURING THE EXAM:
Tip #3: Forget about customizing the .vimrc/.bashrc files. I was not able to find them in the home folder anyway. Honestly, all you will need to do when you see the shell is:
# set autocompletion
source <(kubectl completion bash)
# set autocompletion to work with the alias “k”
source <(kubectl completion bash | sed ‘s/kubectl/k/g’ )
Tip #4: Initially, browse the exercises real fast and attempt the ones with highest points first. Leave the ones with 2%-4% weight for the end.
Tip #5: Be cautious with namespaces. Some of the tasks ask you to place the resource on a specific namespace. Given a YAML file that defines a Kubernetes resource, make sure you know where exactly to place and specify the namespace. The position changes depending on the resource type and I found it difficult to spot both in the official Kubernetes documentation and with command
kubectl explain ....
Tip #6: Solve all subtasks of every task before moving to another task. This way you will not forget to run the
kubectl use-context ...command which is given in the beginning of each task.
Tip #7: Export to YAML the requested object(s) from each task. This way in case you mistakenly edit a resource you can recreate it from the file. In addition, for the YAML files follow the naming convention: e.g. task01.yaml, task03_deploy.yaml, task03_svc.yaml. This way with a simple
ls -lin your home directory you can see easily which tasks you have already done and which not.
Tip #8: Use the
Ctrl + rshortcut to navigate bash history. It can be quite helpful given that some kubectl commands needed minor changes in order to answer different tasks.
Tip #9: When you are asked to create a service for an existing resource, use the command
kubectl expose -f existing_resource.yaml. It will save you time editing tags. Which is booring!
In case you do not pass with the first try, do not despair. You can definitely do it on the second try. Good luck!
If you found anything useful here, please click that clap :)