CertLumen

Certified Kubernetes Application Developer (CKAD) · Section 3 · 15% of the exam

Debugging in Kubernetes

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

A systematic method for finding out why a Pod will not start, keeps crashing, is not reachable or fails a rollout. You will map Pod statuses and exit codes to causes, check Services and endpoints, and use exec, port-forward and ephemeral debug containers.

Points to remember

  • Method: get, then describe (events, last state), then logs (and --previous), then exec or debug.
  • Pending is a scheduling problem; ImagePullBackOff an image or registry problem; CreateContainerConfigError a missing ConfigMap, Secret or key.
  • CrashLoopBackOff is a symptom; read the exit code (137 OOM or SIGKILL, 143 SIGTERM, 127 command not found).
  • READY 0/1 with Running means the readiness probe fails or the app is not listening.
  • Empty kubectl get endpoints means label/selector mismatch or unready Pods; refused connections suggest a wrong targetPort.

Try a question

A Pod crash-loops immediately after a command change. The team wants to explore the filesystem of the same container image, with the original command replaced by sleep, without touching the running Pod. Which approach is best?

  1. Akubectl debug <pod> -it --copy-to=<pod>-debug --container=app -- sleep 3600
  2. Bkubectl exec <pod> -it -- sleep 3600 inside the crash-looping container
  3. Ckubectl patch pod <pod> to change spec.containers[0].command to sleep
  4. Dkubectl rollout restart with a new image that sets the sleep command
Show the answer

A. kubectl debug --copy-to creates a new Pod from the original spec with modifications such as a different command or image. It is the right tool for crash-looping containers; delete the copy when finished.

Written for practice in the style of the exam: never a question from the real exam.

In the course

The lesson Debugging Applications in Kubernetes teaches this objective (about 45 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.

More in this section

← Previous objective · All 24 objectives · Next objective →