CKA Resource Monitoring 3 — Questions and Answers
Question 1: In Kubernetes, what does a QoS class of 'Burstable' mean for a pod?
- At least one container has requests set but requests do not equal limits (Correct answer)
- All containers have equal requests and limits
- No containers have any requests or limits set
- The pod has a PriorityClass assigned
Correct answer: At least one container has requests set but requests do not equal limits
A Burstable pod has at least one container with resource requests defined, but the requests and limits are not equal for all containers.
Question 2: Which QoS class is the LAST to be evicted when a node is under resource pressure?
- Guaranteed (Correct answer)
- Burstable
- BestEffort
- Critical
Correct answer: Guaranteed
Guaranteed pods have the highest priority and are the last to be evicted; BestEffort pods are evicted first, followed by Burstable pods.
Question 3: A Metrics Server is installed and running, but 'kubectl top pods' returns 'Error from server (ServiceUnavailable)'. What is the most likely cause?
- The Metrics Server pod is not yet ready or its aggregation API is not registered (Correct answer)
- The Metrics Server requires a restart of kube-apiserver
- The kubelet on every node must be restarted
- The Horizontal Pod Autoscaler is conflicting with Metrics Server
Correct answer: The Metrics Server pod is not yet ready or its aggregation API is not registered
If the Metrics Server pod is not ready or its APIService is not registered with the aggregation layer, the kube-apiserver returns ServiceUnavailable for metrics endpoints.
Question 4: What flag must be passed to 'kubectl top pods' to also display metrics for init containers?
- --containers (Correct answer)
- --init-containers
- --all-containers
- --include-init
Correct answer: --containers
The '--containers' flag causes kubectl top pods to show per-container metrics, including init containers alongside regular containers.
Question 5: A ResourceQuota is set in a namespace with 'requests.cpu: 4'. What happens when a new pod requests 1 CPU but the total existing requests are already 4 CPU?
- The pod creation is rejected with a 'forbidden: exceeded quota' error (Correct answer)
- The pod is created but placed in a Pending state
- The pod is created and an existing pod is evicted
- The ResourceQuota limit is automatically increased
Correct answer: The pod creation is rejected with a 'forbidden: exceeded quota' error
ResourceQuota is enforced at admission time; if the quota is exhausted, the API server rejects the new pod creation request.
Question 6: Which Prometheus query expression would return the CPU usage rate of a container named 'app' over the last 5 minutes?
- rate(container_cpu_usage_seconds_total{container='app'}[5m]) (Correct answer)
- sum(container_cpu_usage{container='app', range='5m'})
- avg_over_time(container_cpu_seconds{container='app'}[5m])
- increase(cpu_usage_total{name='app'}[5m])
Correct answer: rate(container_cpu_usage_seconds_total{container='app'}[5m])
The rate() function on container_cpu_usage_seconds_total with a 5-minute range is the standard PromQL expression for computing per-second CPU usage of a container.
Question 7: What does the 'container_memory_working_set_bytes' metric represent in cAdvisor/Prometheus?
- Active memory that cannot be reclaimed by the kernel under memory pressure (Correct answer)
- Total memory allocated to the container including cache
- Memory swapped to disk by the container
- Reserved memory from the container's limit setting
Correct answer: Active memory that cannot be reclaimed by the kernel under memory pressure
Working set bytes represents active memory (anonymous + active file-backed pages) that the kernel will not reclaim, making it the most relevant metric for OOM eviction decisions.
In Kubernetes, what does a QoS class of 'Burstable' mean for a pod?