This week I completed my CKA with 96% in just few weeks of learning and in this blog post I will be sharing some tips and guidelines that can help you get one.
Video course :
This is probably one of the best video course you can opt for and that too in really low cost on Udemy (~400 Rs.). The course has both theoretical concepts explained in detail, awesome hands on labs to practice and the mock tests to help pass the exam with flying colours.
Make sure to complete the labs and specially mock exams at-least twice or thrice.
In exam tips :
- No, its not the toughest as mentioned in some medium blogs, it’s easy if you have done the course along with mocks and lightning labs twice.
- Double check the name of the pod / deployment, name of container, service name, context you are using, labels and namespace (it’s silly mistake prone area).
- You will given a bastion host at first which has 5 contexts (clusters) already set. Make sure you are on the right context before starting the exam, its mentioned on top of each question in bold letters.
sshaccess is provided for all 5 clusters (masters and nodes), ssh commands are already provided in questions wherever required.
- K8s version in exam is 1.18 (as of April 2020) so certain commands change like
kubectl runcan now only create pods without
cmd+vworks just fine (for Macbook at least)
- Bookmark cheatsheet page – https://kubernetes.io/docs/reference/kubectl/cheatsheet/
- Set autocomplete before starting – https://kubernetes.io/docs/reference/kubectl/cheatsheet/#kubectl-autocomplete
- Use imperative commands as much as possible and edit as per the requirements of question :
kubectl create deployment nginx --image nginx --dry-run=client -o yaml > deploy.yamland edit deploy.yaml for
xnumber of replicas and apply the
deploy.yamlto create a deployment with
xnumber of replicas.
kubectl run nginx --image=nginx --dry-run=client -o yaml > pod.yamlto create an nginx pod yaml and apply the yaml after making any required changes.
kubectl expose pod/deployment --name nginx-service --type ClusterIP --port 80 --target-port 80 --dry-run=client -o yaml > svc.yamlto expose a pod or deployment
kubectl create secret generic db-secret --from-literal=password=confidential(no need to encode the secret
confidential, its encoded on its own when using imperative commands)
- When you do
--dry-run=client -o yaml, redirect the yaml output to the current question number (like
--dry-run=client -o yaml > 1.yamlfor first question), so later its quick, easy to revalidate the attempt and edit changes if any.
- Following are some other important commands that would be useful :
journalctl -u kubeletto get kubelet service logs (
tailthe logs in case needed)
systemctl status kubelet,
systemctl restart kubeletand
systemctl daemon-reloadto get the status of kubelet and restart in case needed.
kubeadm init --config=/location/of/kubeadm.configto create a kubeadm cluster with provided config
jsonpathis not really needed (simply copy paste the required pod name to required text file name),
--sort-byis needed for sorting resources based on certain criteria.
- Use https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/#create-a-simple-pod-to-use-as-a-test-environment to
ClusterIPservice and pod.
- Make use of
kubectl get pods -l abc=xyzand
kubectl get nodes --show-labelsto get through things faster.
- Yes, you can copy whole yaml from docs as well, so use it for the objects like
persistentvolumesfor which there are no imperative commands instead of typing yaml in vim.
- You will have ample amount of time so make sure to read (twice) and understand the question well before attempting.
- It might take more than 30 hours for getting the results on email and portal.
Finally, special thanks to folks at Srijan for immense support and guidance!
Feel free to get in touch in case of issues and concerns.
$ kubectl get cka