CertLumen

Certified Kubernetes Administrator (CKA) · Section 5 · 30% of the exam

Monitor cluster and application resource usage

One of the objectives of the Certified Kubernetes Administrator (CKA) exam, in the section “Troubleshooting”. Here is what it covers, the points to remember and a question to try.

What it covers

How to see what the cluster and its applications consume: the Metrics API and metrics-server, kubectl top, requests, limits and QoS classes, OOMKilled and CPU throttling, node capacity and allocatable, events, and the probes and signals that show an application is unhealthy.

Points to remember

  • metrics-server serves the Metrics API (metrics.k8s.io) via APIService v1beta1.metrics.k8s.io; kubeadm does not install it.
  • kubectl top node|pod shows current use (CPU in millicores, memory working set); --containers, --sort-by, -A.
  • describe node shows requests and limits against allocatable; top shows actual use.
  • CPU over limit is throttled; memory over limit is OOMKilled (exit 137).
  • QoS classes: Guaranteed (requests = limits), Burstable, BestEffort; BestEffort is evicted first.

Try a question

A Java application Pod restarts every few hours. kubectl describe pod shows Last State: Terminated Reason: OOMKilled Exit Code: 137. The container has limits.memory: 512Mi. kubectl top pod shows steady growth to about 500Mi before each restart. Which action is the most appropriate?

  1. ARaise the CPU limit so that garbage collection runs faster and the heap can be reclaimed before the limit
  2. BSet the liveness probe to restart the Pod earlier, before the heap reaches the memory limit of the container
  3. CChange the Pod's QoS class to BestEffort so that the kernel no longer enforces a memory limit on it
  4. DRaise the memory limit and request after checking the application's heap settings and leak
Show the answer

D. OOMKilled points to memory. Look at the heap (for example -Xmx versus the limit), memory leaks, and the working set from kubectl top.

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

In the course

The lesson Monitoring Cluster and Application Resource Usage teaches this objective (about 45 minutes), and 16 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 27 objectives · Next objective →