Kcna Kubernetes And Cloud Native Associate · Free Practice Question Medium
Question 57
Which of the following scenarios could lead to a Pod being evicted due to resource constraints?
-
A
The Pod's memory limit is reached, and the node is under memory pressure.
-
B
The Pod's memory request is higher than its memory limit.
-
C
The Pod's CPU limit is lower than its CPU request.
-
D
The Pod has no resource requests or limits defined.
-
E
The Pod's CPU request is higher than the available CPU resources on the node.
Reveal correct answer
Correct answer: A
A.
When a node in a Kubernetes cluster is under memory pressure, meaning it is running low on available memory, the kubelet will begin evicting Pods to free up resources. Pods that have reached their memory limit are more likely to be evicted under such circumstances.
B.
Like the CPU, memory requests are considered when the Pod is first scheduled. If the memory request is higher than the memory limit, this is also an inconsistent configuration and will result in a validation error.
C.
The CPU limit being lower than the CPU request is an inconsistent configuration and will result in a validation error. Kubernetes won't allow such a Pod specification to be created.
D.
While it's true that Pods without resource requests or limits defined could potentially be evicted if the node experiences resource constraints, they aren't evicted due to reaching any defined resource limits, which is what the question specifically asks.
E.
CPU requests are taken into account by the Kubernetes scheduler when initially placing Pods onto nodes. If a Pod's CPU request is higher than the available CPU resources on the node, the Pod simply won't be scheduled on that node in the first place; it won't be evicted for this reason.
Discussion
Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.
