Certified Kubernetes Application Developer (CKAD) · Section 3 · 15% of the exam
Use built-in CLI tools to monitor Kubernetes applications
One of the objectives of the Certified Kubernetes Application Developer (CKAD) exam, in the section “Application Observability and Maintenance”. Here is what it covers, the points to remember and a question to try.
What it covers
Use kubectl top, get, describe and events to see what your application is doing, then use kubectl logs with the right flags to read current, previous and multi-container output. You will also learn where logs live and why they disappear.
Points to remember
kubectl top pod|nodeneeds metrics-server and shows current CPU (millicores) and memory, not history, requests or limits.--sort-by=cpu|memory,--containers,-Aand-lrefinekubectl top.kubectl describeshows conditions, state, last state, exit code and events; events live about one hour by default.kubectl get -o wide|yaml|jsonpath,--sort-by,-wandkubectl waitcover most observation tasks.- Containers should log to stdout and stderr; the kubelet stores and rotates the files (10Mi and 5 files by default).
Try a question
A container in a Pod has crashed and been restarted. Which flag of kubectl logs shows the output of the previous, terminated instance?
- A
--follow - B
--since=1h - C
--previous - D
--all-containers
Show the answer
C. kubectl logs <pod> --previous reads the log of the last terminated container instance, essential for CrashLoopBackOff diagnosis.
Written for practice in the style of the exam: never a question from the real exam.
In the course
The lesson Monitoring with kubectl and Reading Container Logs teaches this objective (about 40 minutes), and 11 practice questions test it. The course has lessons, exam-style questions, timed practice exams and an AI tutor for every objective, and a pass prediction that tells you when you're ready to book.