CKA Practice Test 1

Tuesday, Aug 18, 2020| Tags: kubernetes, cka, certification, exam, practice test

More than 2 years ago when I passed CKA, there were fewer resources available for me to study. I had to create a lot of resources myself during my cert preparation. During many of the certification exams that I have taken over a period I have realized that having a set of of test questions is incredibly helpful. I am posting the below practice exam questions that will be helpful to those aspiring to pass CKA.

Many of these questions have been sourced from internet, and many of these have been written by me. There are 2 sets of practice tests that have some of the overlapping questions.

I would recommend that you practice these in a compressed timeline (preferably finish them in 1.5 Hrs as opposed to 3 Hrs) at your home. Idea is that, if you are able to finish the exam in 1.5 Hrs at your home you will be able to finish the exam in 3 Hrs an a much more tense situation when you are under pressure.

Here is the first set:

  1. Create a node that has an SSD and label it as such.
    1. Create a pod that is only scheduled on SSD nodes.
  2. Create 2 pod definitions: the second pod should be scheduled to run anywhere the first pod is running - 2nd pod runs alongside the first pod.
  3. Create a deployment running nginx version 1.12.2 that will run in 2 pods
    1. Scale this to 4 pods.
    2. Scale it back to 2 pods.
    3. Upgrade this to 1.13.8
    4. Check the status of the upgrade
    5. How do you do this in a way that you can see the history of what happened?
    6. Undo the upgrade
    7. Expose the service on port 80
  4. Create a pod that uses a scratch disk.
    1. Change the pod to mount a path on the host.
  5. Taint a node and run a Jenkins Pod on that specified node only.
  6. Create a pod that has a liveness check
  7. Use the utility nslookup to look up the DNS records of the service and pod.
  8. Find which Pod is taking max CPU
  9. List all PersistentVolumes sorted by their name
  10. Create a daemon set
    1. Change the update strategy to do a rolling update but delaying 30 seconds between pod updates
  11. Create a static pod
  12. Create a busybox container without a manifest. Then edit the manifest.
  13. Create a pod that uses secrets
    1. Create a secret
    2. Pull secrets from environment variables
    3. Pull secrets from a volume
    4. Dump the secrets out via kubectl to show it worked
  14. Create a job that runs every 3 minutes and prints out the current time.
  15. Create a job that runs 20 times, 5 containers at a time, and prints “Hello parallel world”
  16. Create a horizontal autoscaling group that starts with 2 pods and scales when CPU usage is over 50%.
  17. Create a custom resource definition - CRD
    1. Display it in the API with curl
  18. Create a networking policy such that only pods with the label access=granted can talk to it.
    1. Create a nginx pod and attach this policy to it.
    2. Create a busybox pod and attempt to talk to nginx - should be blocked
    3. Attach the label to busybox and try again - should be allowed
  19. Create a service that references an externalname - https://api.github.com/users/prabhatsharma
    1. Test that this works from another pod
  20. Create a pod that runs all processes as user 1000.
  21. Create a namespace
    1. Run a pod in the new namespace
    2. Put memory limits on the namespace
    3. Limit pods to 2 persistent volumes in this namespace
  22. Write an ingress rule that redirects calls to /foo to one service and to /bar to another
  23. Write a service that exposes nginx on a nodeport
    1. Change it to use a cluster port
    2. Scale the service
    3. Change it to use an external IP
    4. Change it to use a load balancer
  24. Deploy nginx with 3 replicas and then expose a port
  25. Use port forwarding to talk to a specific port

2nd set is at CKA exam practice test 2

Feel free to add any questions in the comment section that you have created or have found in the wild.



Comments