Clicky

Preparing for the CKAD Exam

There are plenty of blog posts out here about how to prepare for the CKAD exam. I read many of them before studying and taking the test. I'm going to go over what advice they shared that I thought was useful and which advice I would ignore if I were going to do it again. Keep in mind that I had about two years of experience working with Kubernetes daily before realizing I should get certified and that shaped the tips I found useful.

Certified Kubernetes Application Developer Certification

Dos

Practice, Practice, Practice

Practice, practice, practice is the biggest advice I would give anyone attempting to get certified. The test is 100% hands on and if you don't know kubectl backwards and forwards you probably aren't going to do very well on the test. If you have experience working with Kubernetes in production you'll likely already know how to solve most problems on the test. However, I don't use kubectl in my day-to-day work. We use GitOps to make changes to our clusters. We also use tools like K9s when we need to manually monitor the status in the clusters. It is important to transfer that knowledge and learn how to do the same things using kubectl.

The two best ways I found for actual hands-on practice were a Github Repository of CKAD Exercises, and Hands-on CKAD Exercises on Katcoda. I spent most of my time preparing going over the Github repo until I could do every exercise without looking at the documentation or the answers. I reviewed the concepts that I knew I was weaker at and then tested myself on Katcoda to make sure I was up to speed. I think any person could probably run through both of these exercises until they understood all the principles and they would be ready to take the CKAD exam.

Learn Vim

Learning Vim should not only be a recommendation for getting certified but just life in general. Everyone should learn Vim. It's probably in the top five most useful tools ever invented. During the test, you will need to edit YAML files before applying them to the test clusters. Use whatever editor you feel comfortable with but make sure you can easily edit files from the CLI because you will be doing it a lot during the test. The CKAD certification test is timed and being able to edit files quickly will keep you from wasting time that could be used to solve the problem.

Use --dry-run=client -o yaml

Let kubectl do all the heavy lifting for you. It can generate resources for you and store them in a YAML file. For example, you can run kubectl run busybox --image=busybox --restart=Never -o yaml --dry-run=client > pod.yaml and it will create an example Pod spec in a file for you. For most problems, this strategy (regardless if you are creating deployments, services, etc.) gets you 90% of the way through the problem and then you just need to make a couple of tweaks manually. The only resources that kubectl doesn't automatically generate for you that are a part of the test are NetworkPolicies, PersistentVolumes and PersistentVolumeClaims. Make sure you know where in the documentation you can find examples of those to use if needed.

Use kubectl explain

For some problems, I knew the general idea of what I needed to do because I had done it before, but I didn't do it often enough that I knew the exact key or spot in the spec to add something in. kubectl explain was the easiest way to look those kinds of things up quickly. For example, I know what ReadinessProbes are, but I don't always know the exact spec for adding one to a deployment. The command kubectl explain deployment --recursive would give me all the top-level fields of a deployment and then I can drill into the spec looking for what I need. This can be combined with grep for some easy searching. kubectl explain deployment.spec.template.spec.containers | grep read.

Get familiar with the reference docs

If you aren't as familiar with a certain concept, (I use persistent volumes very rarely), go over the docs and know where to find the information you will need on the test. You can have one browser tab open and I did use it a couple of times to look up things I knew about but couldn't remember.

Don'ts

Create a bunch of aliases

On almost every blog I read, I saw advice to create a bunch of aliases at the beginning of the test to help you go faster. I thought the only aliases worth saving were:

alias k="kubectl"
alias ka="k apply -f"

Those two things I did over and over and over again. There was enough variability in the rest of the commands I was running that trying to remember aliases for them would have taken me longer than just typing out the commands when I needed them.

Use auto-completion or IDEs like K9s and Lens

I already mentioned this up above, but don't use any tools as you are practicing that you can't use on the test. Don't worry about auto-complete or any IDE-like environments that make your life easier. They will only hurt you in the test if you don't understand all the kubectl commands you need to solve a problem. Sure, you can always look things up in the documentation. That does take time and that may not be something you have a lot of.

Results

I only took about an hour and a half on the test and that included going over each question and answer multiple times. If you are well prepared the time limit won't be an issue (Of course, everyone tests differently, so if you are a slow test taker normally consider that). From my work experience and the advice mentioned in this article, I was able to pass the exam with a 98/100. I like how the CKAD is set up to be a hands-on test and prefer that over a multiple-choice test any day (I'm looking at you AWS).