Certified Kubernetes Administrator (CKA) — Tips and Tricks — Part 1

Arun Ramakani
Dec 1, 2019 · 4 min read

Certified Kubernetes Administrator is a challenging exam by CNCF. Unlike many other certifications, it’s a practical lab. It took two attempts for me to get through. Thought sharing my experience will help you all in passing with flying colors. There are many aspects to clearing the exam with ease, one of the aspects is “Time Management”. We will look into time management today and look at the other aspects in an upcoming article.

You are given 24 questions within 3 hours, some of the questions may be tricky and eat a lot of your time. You have to score 76 and above to clear the exam. This means you are supposed to attend almost all the questions, with limited mistakes. Let’s see, how to get your time management correct.

Tip 1: Create Aliases

kubectl is the most-used tool throughout the exam. You will be spending a lot of time in typing kubectl command. It is worth to create aliases to use time more efficient and effective. On my first attempt, I answered only 20 out of 24 questions due to inefficient time management. That atleast saved me 15 min on my second attempt by creating following alias.

# Get resources

alias k=”kubectl”
alias kn=”kubectl get nodes -o wide”
alias kp=”kubectl get pods -o wide”
alias kd=”kubectl get deployment -o wide”
alias ks=”kubectl get svc -o wide”

# Describe K8S resources

alias kdp=”kubectl describe pod”
alias kdd=”kubectl describe deployment”
alias kds=”kubectl describe service”
alias kdn=”kubectl describe node”

Tip 2: Finish the easy once first

On my first attempt, I got stuck with a tricky question on static pods. ( we will talk about it in detail in the next blog) . It took almost 30 min on that question still, I got it wrong at the end. You can’t waste your time like this. If you are struck more than 10 min on a question, jump to the next one. You can always come back and re-attempt at the end. Attempting all the low hanging fruits will help gain quick confidence.

Tip 3: Don’t fight with YAML’s

Kubernetes is all about YAML’s and typing it all yourself is a hell. It’s very easy to forget some attributes in YAML or get an alignment issue. This is not a good way to spend your time. Always use YAML generators to get your YAML generated.

Generate pod yaml with below command

kubectl run — generator=run-pod/v1 nginx — image=nginx -o yaml — dry-run > nginx.yaml

Generate deployment yaml with below command

kubectl create deploy nginx — image=nginx — dry-run -o yaml > nginx-ds.yaml

Generate service yaml with below command

kubectl expose pod hello-world — type=NodePort — name=example-service

kubectl expose deployment hello-world — type=NodePort — name=example-service

You can also generate YAML from existing resources from the cluster and then edit as you need nor your work. For example, if you are trying to create a deployment and there is one already running, try using:

kubectl get deployment “deployment name” -n “namespace” -o yaml > “new-deployment.yaml

This will give you a working deployment yaml that you can edit and apply to make sure you’ve got one working.

Tip 4: Reuse YAML’s

You will need to create pod and deployment resources again and again. Once yaml is generated for a pod or deployment, we can easily reuse the same yaml for different questions with small modifications.

cp pod1.ymal pod2.yaml

Some may feel using the Tip 3 is better than tip 4. Try and determine which is faster for you.

Also, visit other tips and tricks for Certified Kubernetes Administrator (CKA)

We will look into other tips and tricks in an upcoming article. Let you pass with flying colors :)

Arun Ramakani

Written by

#ContinuousDevOps #Kubernetes #Microservices #CloudNativeApps #DevOps #Agile #CodingArchitect

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade