So, I finally got the little green tick of having CKA certification in my certification list. I put off this exam for so long that it seriously became not funny anymore. The internet has quite literally way more than 1000 posts on this topic. But what harm would one more post cause? So here's mine. I will write it from my perspective.
I am writing this post just in case if anyone benefits from it, as I predict there could be many on the same boat as me.
Background:
Kubernetes, modern application architecture, DevSecOps etc are not new territory for me. In fact, I think I am fairly versed in K8s and related tech stack. But due my own imposter syndrome I have been putting off sitting the CKA exam. However, last week I thought about the CKA as "just another approval for my skills" and got the nudge to sit the exam.
Here's what I did till the day I sat for the exam. (Everybody is different but the below worked for me the best)
The preparation:
As I have been working with K8s for sometime and I did not need to learn it from scratch. So I went ahead and bought it from CNCF and booked the exam 5 days out. Now that I have a target date I commenced working towards it. Here're the strategy I followed:
Hands on:
I think one of reasons why my imposter syndrome was preventing me from taking the exam was that the format is hands on (as opposed to multiple choices). But the good news was that it was also open book (meaning I have access to the documentation). So the strategy needed to be slightly different.
I practiced a lot:
I did not buy any course but I practiced a lot (I think) for 4 days (approx 2-3 hours a day, early mornings and late evenings). There are 1000s of free good practice materials (they are almost the same) on the internet. I will drop a few here for starter that I used:
- https://www.youtube.com/watch?v=udA3OWkmMUY
- https://www.youtube.com/watch?v=Zm5sy6otLGc
- https://medium.com/@texasdave2/preparing-for-the-kubernetes-certified-administrator-exam-with-practice-questions-148ab774094f
- https://killercoda.com/killer-shell-cka
- https://dev.to/subodev/50-questions-for-ckad-and-cka-exam-3bjm
- The 2 mock killer.sh session that comes with exam purchase.
I memorised some basic commands:
k run <pod name> --image=<image name> --labels="key1=value1,key2=value2" [--oyaml --dry-run=client > pod.yaml] [--command -- sh -c "sleep 1d"]
k exec -i <podname> -- sh -c "cat /var/logs/log.txt"
#Note: I predict that in the exam it will most likely be multi-container and through this command
there's no way to create multi-container deployment.
That means saving the yaml with 1 container and adding the adding the additional containers.
k create deploy <deploy name> --image=<image name> --replicas=<count> [--oyaml --dry-run=client > pod.yaml]
k expose deploy/pod <object name> --name=<name of the svc> --port=80 [--target-port=8080] [--type=NodePort/ClusterIP]
k create role or clusterrole <name> --verb=<create,delete,list etc> --resource=<pod,deploy,secret etc>
k create rolebinding or clusterrolebinding <name> --role/clusterrole=<role or clusterrole name> --serviceaccount=<namespace>:<SA name>
# to verify the above:
k auth can-i create deploy --as=system:serviceaccount:<namespace>:<sa name>
k scale deploy/replicaset/statefulset <name of object> --replicas=<desired count>
k rollout history/restart/undo deploy/pod <object name> # rollback a deployment etc
k set image deploy/pod <object name> <existing container name>=<new image name> --record
#sortby ASC order k get pods -A --sort-by=.metadata.creationTimestamp --no-headers| tac ### Check certificate validity openssl x509 -noout -text -in /etc/kubernetes/pki/etcd/server.crt ### Check etcd snapshot status ETCDCTL_API=3 etcdctl snapshot status /etc/etcd-snapshot.db ### Check kubeproxy running crictl ps | grep kube-proxy crictl logs 27b6a18c0f89c ### Check kube-proxy is creating iptables rules for a given svc ssh cluster1-controlplane1 iptables-save | grep p2-service ### Change the Service CIDR to 11.96.0.0/12 for the cluster. vim /etc/kubernetes/manifests/kube-apiserver.yaml check for restart --- kubectl -n kube-system get pod | grep api ### CNI conf location /etc/cni/net.d ### kill container running on kube-proxy on node01 ssh node01 crictl ps | grep kube-proxy
crictl stop 28of363745
crictl rm 28of363745
### write the names of all namespaces resources k api-resources namespaced=true -o name ### count line numbers k get roles -n project-c14 | wc -l ### troubleshoot kubelet journalctl -u kubelet ### get version info to install (eg: kubeadm, kubelet, etc) apt show kubectl -a | grep 1.29 ### join node with cluster - get into controlplane --- ssh cluster3-controlplane1 - then print join command: kubeadm token create --print-join-command # no need to memorise this command find it in doco.
The vim editor:
- 'i' to start editing
- 'i' + right click paste to paste from clipboard
- 'v' to mark texts (that I need to do something with)
- 'x' to cut the marked text (i mainly used this method to delete stuff quickly from the copied yaml from doco).
- 'y' to copy the marked text
- 'shift + p' to paste the text (copied via the above).
- 'shift + >' to indent left
- 'shift + <' to indent right
The documentation:
- PV, PVC and using then in Pod (search term: Pod PersistentVolume)
- NetworkPolicy
- EtcdCTL (search term: etcdctl snapshot and find a sample command in the middle of the page)
- Taint and Tolerations (search term: pod toleration)
- Pod Resource utilisation
- Sidecar (search term: Sidecar container)
Getting familiarity with few uncommon things:
- NetworkPolicy
- Taint (how to taint and untaint, schedule a pod/deploy on a tainted node/controlplane etc)
- EtcdCTL (taking backup and restore, validate a backup) ## This is very important.
- Kubeadm (upgrading a kubeadm cluster) ## this is very important
The 120 mins of the exam:
- Launch the exam 15 mins before the time. It is online proctored and needs few validation/checks etc such as taking a photo with id/diver's license, the proctor person with ask to pan the camera/latptop webcam to check the desk, exam area etc. I cleaned my desk completely and I only had my laptop and powerchord on the desk. No mobile phones, no paper etc are allowed. I also used my personal laptop to avoid any potential firewall/remote session block from work laptop.
- There's no weights mentioned against questions anymore. But I still felt there were some questions (such as multi-faceted questions, questions related to etcd, kubeadm, network policy, role/sa etc) carried more weights.
- I got 17 questions in the exam. The guide suggested 15 - 20 questions.
- I did not revise or do anything before the exam (my exam was in the morning). I willed that I am confident. I had breakfast and coffee. Coffee is super important because the exam is for 120 mins (OMG!! what??!!).
- Because of my above mentioned strategies I completed most of the questions very fast (in about 80 mins). I flagged few for further validation which I did after that 80mins.
- I flagged and skipped the hard ones/or the ones I wasnt confident about just by reading at a glance (I flagged about 3 questions) which I attempted after that 80 mins. This was so that I avoid wasting time behind one question by getting stuck on it.
- It is also important to mention that since the exam is hands on and task based it is very easy (at least for my personality) to get bogged down into 1 specific things and waste time on it. But that 1 specific thing in that multi-faceted question may only carry 1 insignificant point or no points at all. That's why I skipped whenever I felt like I needed to validate more deeply or I am not super confident. And tackled them after I completed majority of the questions. This took off a lot of pressure during the 120 mins.
Comments
Post a Comment