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