How to Pass the CKA Exam

How to Pass the CKA Exam

By Scott Eppler

Recently, I took (and passed!) my Certified Kubernetes Administrator (CKA) exam. This test has a reputation for being quite tough, and that reputation is well-earned. The primary challenge is time. You have just three hours to complete 24 tasks. None of the tasks are particularly difficult given enough time, however, if you do the math, you only get about 7½ minutes for each task. For some tasks, this is more than enough time. When the task is a full-on troubleshooting session, though, you have to know K8s inside and out or it’s going to show. So, how did I get to know K8s so well? I’m glad you asked.

  1. Courses
    Many of the tasks are around using the `kubectl` cli and should be second nature if you’ve worked with K8s regularly. If you haven’t, then you might start with a basic introduction course such as this one at Katacoda or the Learn the Basics course in the Official Kubernetes Documentation. I also read Kubernetes: Up and Running which was a good resource for getting introduced to K8s. There’s also a GitHub Repo for the book that includes all of the example YAML files used.

    From there, it’s time to dive into a deeper course to get to know all of the K8s Primitives. I took the Certified Kubernetes Administrator course at Linux Academy and found it to be well fleshed out, but that has now been replaced by the Cloud Native Certified Kubernetes Administrator course that looks to be even better, with new labs and practice exams. The Official Docs from Kubernetes are also well-written and organized. Working with these is also a good idea, as you’ll have access to them during the test so knowing where to find stuff quickly can be a huge help.

    Finally, there are a few cluster/infrastructure-related tasks. For those, the best resource is Kubernetes-the-hard-way by Kelsey Hightower. This course (well GitHub repo really) takes you through the steps to build an entire cluster from scratch with no helper tools or scripts. I went through this exactly as written, then tried it myself in some of my lab resources (discussed below). Linux Academy also has a Hands-On Lab available that takes you through these same instructions using their Cloud Playground.

  2. Practice
    I cannot stress this enough. As I’ve said, the main challenge is going to be time. Which means that you want to be very comfortable working with `kubectl` and the cluster components and there is no shortcut around this. You just have to work with the tools until you get there.

    First, you’ll need a lab environment. Some good options include Minikube, Docker for Mac/Win, and Play-With-K8s. I also used the Cloud Playground servers at Linux Academy quite a bit.

    Next, you’ll need to know what to practice. There are two primary resources I used for this. 1) the Tasks page on the Official Docs site. 2) The CKA Curriculum document. The curriculum doc provides a high-level view of what kinds of tasks will be required on the test and how much each section is worth. The Tasks page, on the other hand, covers a wide range of tasks with details and steps on how to accomplish those. I tried to go through every task a few times and used the curriculum doc to check myself on areas where I wasn’t as confident. Walid Shaari’s CKA Repo is helpful when trying to match up the items from the curriculum to what’s on the official docs.

  3. Test-Taking Tips
    Once you are comfortable with `kubectl` and all of the K8s cluster components, it’s time to take the exam. I have a few tips that helped me out just before and during the exam that I want to share. First, read all of the CKA Exam documentation. These docs cover a lot of detail around how the test works as well as what’s expected. As noted in one of those documents, you only have a single terminal console so a multiplexer such as screen or tmux is recommended. If you’re not familiar with those, you should spend some time getting to know one. The same can be said for cli-based text editors. I used vim but you should be able to use emacs as well if you like. You may also find it helpful to create a dotfiles repo to configure these tools to your liking. This takes a little time upfront but can save you a lot in the long run.I’m probably beginning to sound like a broken record, but I cannot stress enough how important time management is. Have a strategy for how you plan to manage your time. I used the Notepad feature within the exam to keep track of what tasks I had done and which I had skipped. The test has no other way to keep track of this so it’s up to you! My strategy there was to make a line for each question with the number, percent value (each question has this), difficulty, and a mark if I had completed it (e.g. 1 4% m x). I also had some high-level goals for myself. That is, complete 10 easy tasks in the first hour, 10 medium tasks in the second hour, and leave the final hour for the 4 tough tasks. Following this strategy, I was able to get through all 24 tasks with time to spare to go back and work on the ones I had initially skipped.

    There are also several things you can do to save yourself some time. Just before I took the test I got to know a feature of `kubectl` that I’d never really used. `kubectl explain` is a handy reference for recalling details about a primitive and its JSON/YAML layout. Heptio has a useful blog post for learning more about this command. Also, it’s best practice to write YAML files to create any K8s objects and probably a good idea for the exam as well, but that can take up a lot of time. ‘kubectl’ to the rescue again here. Using the `-o yaml –dry-run` flags and redirecting that to a file is a great way to quickly get you a starting template for most k8s objects. Again, Heptio has a good blog post about this. And, of course, make sure you enable shell completion for kubectl. `kubectl completion <shell> help` has some great instructions for this if you aren’t sure how to do this.

A very practical tip, make sure that you are well-rested and well-fed. You can’t have any food or drink in the room with you and if you request a break to go grab something it still counts against your time. This also means, as silly as it may seem, it’s probably a good idea to go to the restroom just before. Be sure to schedule your exam at a time when you are typically at your most productive (mid-morning for me) and, if possible, do a few of those tasks from the Task page to get yourself in the k8s frame of mind.

Finally, if you don’t pass the first time, you get one free retake, so be sure to make a note of everything you struggled with as soon as possible after you finish, just in case. Best of luck on your exam!

Leave a Reply

Your email address will not be published.