Resources

I used The Linux Foundation courses also in the past when I studied for the CKA. They are good courses to be used

The course is structured in sections covering the major topics of the certification program. Moreover, at the end of each section you have a “knowledge check” chapter containing a few questions that turn out useful to let yourself understand if you got correctly the concepts.

The course I took is: LF…

with sections being: …

Practical tips to nail the exam

Time is key during the exam. The exam simulator I mentioned before is a very good tool to practice your speed and also understand the exam environment. I can tell you that it is pretty similar to the real exam setup. It is useful to gain confidence in the environment you find in the exam and avoids any time wasted because of that.

The exam questions have their value ranging from a 2% to an 8%, that usually also correspond to the question’s difficulty. The percentages are the weight the question has with respect to exam and values I saw were only: 2%, 4%, 6%, and 8%.

Tip 1 - Questions order

My strategy has been to go with questions of more value at first, so to have plenty of time to sovle them, and then to go back to the easier questions. If you prepared yourself well for the exam you will have still a lot fo time to address easy questions after harder ones.

That being said, I also wanted to be sure to properly “warm up” and break the exam tension for sake of performances. That’s why before getting to the harder questions and all the rest of the plan, I put as very first questions a couple of easy ones.

Tip 2 - Windows disposition

For the exam you’ll be using a dedicated software that you will download just before the exam. It is quite similar to a minimal web browser but bound only to your exam session. Nothing special but a ~300 Mb of a portable binary to double-click and run.

When your exam starts the window gets split into 2 panels: a left one with the questions (which I found to be optimally sized around the 15% / 20% of total screen width) and a right panel with a remote-control session over a linux desktop machine.

Into the exam machine, first thing I did was to open terminal (1 tab is usually enough) and the browser (opening docs.kubernetes.io in multiple tabs for faster searches). During practice I got used to a very convenient and time-saving widows disposition: have both the terminal and the browser almost full screen except for some space left on the side of the window, respectively their right and left part. In essence, the setup is useful because with a click you move the focus between the two windows bring to the front the other very easily. But.. why am I even spending precious bytes and time writing this down? Reason is that common Alt-Tab key-bindings don’t work over the remote session and depending on your exam (not just your connection quality!) the remote control session can be sometimes lagghy… mouse is what you have to rely on.

Tip 3 - The bashrc configs and tuning

Searching for “kubectl cheatsheet” in kubernetes docs, you will be able to copy-paste into the .bashrc all the useful things.

# needed from autocompletion, at the top docs of page:
source <(kubectl completion bash)
# just below in docs, the shorthand alias "k" and its autocompletion
alias k=kubectl
complete -o default -F __start_kubectl k

# From the section "Kubectl context and configuration", 
# copy first par of the command with the comment "permanently save the namespace for all subsequent kubectl commands in that context"
# kun: kubectl use namespace 
alias kun='kubectl config set-context --current --namespace'

To me it really made the difference this “kun” alias. I was able to very rapidly change a namespace and do so without remembering by heart all the “kubectl config … blah blah” thing..

When getting to a new question during exam, it was very convenient to:

kun ns-name

to then focus on the question and have all the next commands executed into the right namespace.

As much conveninet as the last was this alias:

alias kaf='kubectl apply -f'

so to be able to change very quickly a definition file and apply it:

vim resource-fil<tab> <tab>

# kubectl apply -f <last argument of last command: i.e. filename>
kaf !$

Also very useful form me were:

export do='--dry-run=client -o yaml'
export now='--force --grace-period=0'

# kubectl "delete delete delete = force delete"
alias kdd='kubectl delete $now'

To be used like:

# create a pod file
k run test --image=bash $do | tee pod.yaml
# create a deployment
k create deployment mydepl --image=nginx $do | tee deploy.yaml

# edit the file to add question-asked configurations
vim pod.yaml
# directly apply it
kaf !$

# after some k get po or k describe po <name>, quickly delete resource to recreate it:
kdd pod/<pod-name>

There are people creating even more aliases, more elaborated and fancier. I honestly preferred to keep it simple and “low impact” on my memorization capabilities: exam tension would have had its impact on my memory functioning. Also, except for the fear to forget too many commands, I wanted to have a straightforward, composable and flexible workflow - using more reuse and combine of commands rather than memory to remember what that criptic alias was and what it was suppose to do. Indeed, I initially got greedy in the aliases I setup but then it was more the times I head to tail ~/.bashrc than the actual utility of them.

Anyway, as a last bonus for my “exam mode” brain, I kept something convenient for debugging but not essential:

# kubectl "run busybox / bash"
alias krb='kubectl run bb --rm -it --image=busybox --restart=Never'
# kubectl "run curl". You can also use image=curlimages/curl but nginx is likely to be already locally present - faster startup.
alias krc='kubectl run na --rm -it --image=nginx:alpine --restart=Never'

To be used for debugging:

# run a debug busybox container, automatically deleting pod on exit
krb

# run a curl-equipped container, automatically deleting pod on exit
krc

Summary of bashrc created

# from docs.kubernetes.io > search > kubectl cheatsheet
source <(kubectl completion bash)
alias k=kubectl
complete -o default -F __start_kubectl k

# just scrolling down to section "Kubectl context and configuration"
alias kun='kubectl config set-context --current --namespace'

# memorized and written by hand

export do='--dry-run=client -o yaml'
export now='--force --grace-period=0'

# kubectl apply file
alias kaf='kubectl apply -f'

# kubectl "delete delete delete = force delete"
alias kdd='kubectl delete $now'

# BONUS
# kubectl "run busybox / bash"
alias krb='kubectl run bb --rm -it --image=busybox --restart=Never'
# kubectl "run curl". 
alias krc='kubectl run na --rm -it --image=nginx:alpine --restart=Never'