I’ve not posted for a few weeks, one of the reasons is that I’ve been studying for the Certified Kubernetes Administrator exam. If your not aware of this exam, it’s designed to test your ability to be able to manage and support Kubernetes. Unlike Microsoft exams, it is 100% lab-based, so you really need to be able to demonstrate the skills expected in the exam.
I took the exam last week, and 36 hours later, I got the result that I had managed to pass. I found this to be probably one of the most demanding exams I’ve taken, and I learned a lot whilst studying for it. I came at this exam from the perspective of someone primarily using Kubernetes in Azure, and I thought it was worth looking at a few areas where I had to change things up a bit, and some tips and suggestions if you’re considering doing this exam.
AKS is Not Enough
I work with AKS every day, and it’s my hosted Kubernetes cluster of choice. However, if you want to pass the CKA, you are going to need to go beyond it. Some areas of the exam, where you are creating pods, deployments etc. you can absolutely practice on AKS. However, there are areas where you will need to get access to the master nodes, you need to undertake Kubernetes upgrades using KubeADM, or you need to debug issues with nodes that you won’t have access to in AKS.
So, you’re going to need access to a non-managed cluster as part of your study. You could still deploy this in Azure using VM’s, you could deploy to a set of Raspberry Pi’s, which is what I did, or if your using some of the training provides like Linux Academy or A Cloud Guru, they provide some cloud servers for you to practice against.
You Don’t Have to Do It the Hard Way
You’ll find a lot of articles online that suggest you follow the “Kubernetes the Hard Way” (KTH) tutorials, which have you install Kubernetes from scratch following a manual process. Now don’t get me wrong, KTH is a great way to learn about the internals of Kubernetes, how clusters work and how each component works and if you want to be an expert on the internals of Kubernetes you should look at this. However, if your aim is to pass the exam, then it’s not a mandatory requirement. This is particularly true for the latest version of the exam where you can use KubeADM to undertake upgrades.
This is not to say you don’t need to learn about the internals of Kubernetes. You still need to understand about SSL certificates, service management, network logs and so on.
Learn the Right Shortcuts
You don’t have a lot of time in the exam, only 2 hours, and so finding ways to speed up your work is essential. You will find a lot of articles talking about using the
kubectl run xxxxx --dry-run -o yaml to generate a YAML file for the resource you want to generate, which you can then edit. Whilst this works for creating a Pod, since Kubernetes 1.18 it no longer works for creating other resources, it is Pods only. You can use
kubectl create xxxx --dry-run=client -o yaml , but this is only supported by some resources. You can use it for deployments, but not daemon sets. It also has a much-reduced set of options.
I found my self using a combination of Kubectl run, create and a lot of copying and pasting from the docs pages. Probably not the fastest but it got the job done.
Set Up Your Environment
When your working in your Kubernetes clusters you’ve probably got all sorts of shortcuts, configuration settings and so on. To help speed up things when you’re in the exam, you’re going to want to do a few things to configure your environment.
Enable Kubectl auto-completion using the commands in the docs
Setup an alias for Kubectl -
Setup a shortcut for outputting to a YAML file
do = dry-run=client -oyaml $do
Setup VIM (or your preferred text editor) to work with YAML, I set the following:
set ts=2 set number set expandtab
Use the Docs
During the exam you have access to the following in a second tab (but only one tab):
Note that despite what other articles might mention, you are not allowed to access the Kubernetes.io discussion forums. There is nothing physically stopping you going to these links, so you need to make sure you look at the URL before you click. If you get it wrong, you could end up forfeiting the exam.
The Kubernetes cheat sheet is a great place to start with, as well as using the search function in the docs.
As well as this, you have access to any docs available in the terminal, so you can use both
kubectl explain and man pages.
Plan Your Time
You only have 2 hours to do the exam, which is tight. It is worth spending a little bit of time at the beginning of the exam looking at the questions and finding the ones you know you can answer and prioritising those over the ones you might need to take more time working out. You also want to look at the score; each question has a % score assigned to it, so you can prioritise them by score as well.
You can mark any questions you have not finished so that you can come back to them later, so try not to spend too long on a question if you are stuck. Mark it and come back to it later.
Use the Notepad
You get access to a notepad in the exam terminal, use this to help you copy and edit text from the docs, make notes, list the order of questions you want to answer etc.
If your planning on taking the exam, I hope these tips help a bit, and good luck!