Appendix D. Solving the exam practice exercises
This appendix provides guided solutions to the practice exercises found at the end of each section, organized by chapter, starting with chapter 1. Rather than jumping straight to the answers, I encourage you to simulate the exam environment. Work through each problem as if it were a real CKA Exam question. If you’ve studied the material many solutions should be come naturally, but if you encounter challenges this appendix is here to help you get unstuck.
D.1 Chapter 1 Exam Exercises
There were fewer exam exercises in this chapter as this was an introductory chapter. The exercises are more exploratory, which we’ll go through here.
D.1.1 SWAPI API similarities
In chapter 1, we highlighted the similarities between the SWAPI (https://swapi.info/playground) and the Kubernetes API. If we send the GET request to https://swapi.info/api/starships/9/ , it returns the object representing the “Death Star”. This includes fields such as name, model, and manufacturer. In a similar way, retrieving a deployment object in Kubernetes, typically using kubectl, involves sending a GET request to and endpoint like https://kind-control-plane:6443/apis/apps/v1/namespaces/default/deployments.
D.1.2 Listing API Resources
D.1.3 Listing background processes
D.1.4 The status of the kubelet service
D.1.5 Use journalctl
D.2 Chapter 2 Exam Exercises
D.2.1 Shortening the kubectl command
D.2.2 List Kubernetes system pods
D.2.3 Upgrading the control plane
D.2.4 Listing the files in the PKI directory
D.2.5 Viewing the kubelet client certificate
D.2.6 View the CRI implementation via crictl
D.2.7 List the running containers and restart apiserver
D.2.8 Determine what CNI installed using kubectl
D.2.9 List the StorageClasses
D.3 Chapter 3 Exam Exercises
D.3.1 Create a role
D.3.2 Create a role binding
D.3.3 Creating a new user
D.3.4 Adding user sandra to kubeconfig
D.3.5 Create new service account
D.3.6 Create a new cluster role
D.4 Chapter 4 Exam Exercises
D.4.1 Apply a label and create pod
D.4.2 Edit a running pod
D.4.3 Use node affinity for a new pod
D.4.4 Create a pod with limits
D.4.5 Create deployment with oversubscribed requests
D.4.6 Create a pod with configmap as environment variables
D.5 Chapter 5 Exam Exercises
D.5.1 Scaling replicas in a deployment
D.5.2 Update the image
D.5.3 View ReplicaSet events
D.5.4 Rollback to a previous version
D.5.5 Change rollout strategy
D.5.6 Cordon and uncordon a node
D.5.7 Remove taint from a node
D.5.8 Install cert manager operator with helm
D.6.1 Exec into a pod