CKA Exam
After a little over 2 months of slow but consistent progress, I finally attempted the Certified Kubernetes Administrator (CKA) exam today. Here are some notes and tips on the whole ordeal.
Preparation
I prepared using the video lessons and labs from the excellent and well-recommended Kodekloud CKA course. All the topics were explained in-depth and there were links to other supplementary resources when necessary. I believe that the labs they offer for each section were the most beneficial. After watching the lectures for a topic, there would be a lab with a k8s cluster already set up and hands-on questions about the material for you to solve. And in case you break something, it's super easy to stop the lab and start over on a clean slate.
There's even vanilla k8s clusters on different versions that you can do whatever you want with (bound by a certain time duration). I also utilized Kodekloud's cloud environment sandbox for AWS to go through Kubernetes the Hard Way. Although you really don't need to complete this if you're strictly only interested in preparing for material relevant to the exam.
The course also comes with mock tests that have a good amount of difficulty to them. They also have another additional course for more mock tests, but I didn't actually finish this.
The subscription is an easy recommendation for anyone else planning to take this exam just for the labs and sandboxes alone.
I've also heard good things about the A Cloud Guru/ Pluralsight course for CKA. So take a look at that too if you want to explore other options.
The killer.sh tests that you get for free when registering for the exam are also invaluable to fully immerse yourself in the test taking environment before appearing for the actual thing. Some of the questions are a bit trickier than the standard difficulty of the exam but this helps you feeling confident if you're able to complete these mock tests successfully.
Tips
Tip #1 - Shortcuts
Here are the only entries I added to ~/.bashrc and sourced before starting the exam. I don't think you need anything more than this. You can copy most of it from the kubectl cheat sheet. Thankfully, ~/.vimrc is already pre-populated for you with the right tab related options for vim.
source <(kubectl completion bash)
alias k=kubectl
complete -o default -F __start_kubectl k
export do="--dry-run=client -o yaml"
alias kn="kubectl config set-context --current --namespace"
do is good for validating the YAML before actually sending any requests to the API server. And kn becomes handy when you need to be on another namespace and do a lot of tasks there without having to pass in the -n <other-ns> flag each time.
Another very handy bonus tip is that you can press Ctrl+x Ctrl+e to edit a command in the editor before running it. So I also set EDITOR=vim in ~/.bashrc which makes it very convenient to copy commands and edit them with vim.
Tip #2 - Documentation
You have access to the full set of Kubernetes documentation at https://kubernetes.io/docs. So you never need to be able to memorize how to create a pod or a deployment or a PVC. But it is important to know where to find what you're looking for. kubectl create gives you the ability to create a lot of resources but not all of them. So it's good to know that you can create a service account by just running kubectl create sa mysa -n myns instead of copying the YAML from the documentation. Similarly, when creating a PVC or PV, it helps to remember where in the long documentation page is the exact YAML located so you can copy it quickly.
Tip #3 - Skip Questions
Don't try to solve each question linearly. If you find yourself stuck on one of the questions, you should flag it and move on to the next. The difficulty around the questions varies from creating a simple pod to doing a full etcd backup and restore. So you'd wanna make sure that you've attempted all the easy ones first before taking extra time (that you may not get) to come back and re-do the more difficult ones.
Tip #4 - Harder topics
These are topics that I believe are the most challenging. So it helps to spend some extra time digging deep and really getting a feel for how they work.
- Network Policies: It's important to understand how Ingress and Egress work with respect to the pods you're trying to target.
- Etcd backup and restore: I always forget to replace the data-dir volume with the new location when I'm performing a restore. Since the API server is down when you're performing the restore, you can keep an eye on the control plane containers with
crictl ps. - kubeadm upgrades: Even though you can easily look up the steps, it pays to know how the overall process works. Remember to drain the pods from the node and uncordon it after when upgrading the kubelet.
- Certificates: Even though the exam doesn't require you to do anything near a full TLS bootstrap, it's good to understand why these certificates are necessary and which components need a client vs server cert. There's a whole section in the Kodekloud course that goes in-depth into TLS and certificates.
- Network Topology: How do pods talk to each other? Where is the service IP actually created and where is the CIDR range for it configured? What does the CNI network plugin do? These are some basic questions to understand when you're trying to debug why traffic isn't reaching a certain pod. Prepare to dig into bridge networks, virtual interfaces, IP masquerading and more.
The Exam
I did have a small scare initially when I was asked by the proctor to join in again and redo the photo verification for my ID since it was a bit blurry. But everything was good the second time.
During the exam, there's definitely some noticeable lag but the remote desktop is not unusable by any means. It only started getting real bad towards the last half-hour for me by which time thankfully I had completed most of the questions and was going back through some of the ones I'd flagged for later.
Another note for Linux desktop users is that the browser software being used currently, does not support Wayland. So if you're on Ubuntu 24.04 like me, you'll need to log out and select Xorg from the settings cog on the bottom right while logging in.
And that's it! I'll update this post with my results once they come out and I hope this was useful to anyone else planning to take the exam in the future. Good luck!
Update: I'm officially CKA certified with a very respectable score of 88/100.