appendix-d

appendix D Solving the 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 will help you get unstuck.

D.1 Chapter 1 practice exercises

There were fewer exam exercises in this chapter, as this was an introductory chapter, and the exercises are more exploratory.

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 an 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 Using journalctl

D.2 Chapter 2 practice exercises

D.2.1 Shortening the kubectl command

D.2.2 Listing 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 Viewing the CRI implementation via crictl

D.2.7 Listing the running containers and restarting apiserver

D.2.8 Determining what CNI installed using kubectl

D.2.9 Listing the StorageClasses

D.3 Chapter 3 practice exercises

D.3.1 Creating a role

D.3.2 Creating a role binding

D.3.3 Creating a new user

D.3.4 Adding user Sandra to kubeconfig

D.3.5 Creating a new Service Account