Kubernetes and Cloud Native Associate (KCNA) — Question 105
How does Horizontal Pod autoscaling work in Kubernetes?
Answer options
- A. The Horizontal Pod Autoscaler controller adds more CPU or memory to the pods when the load is above the configured threshold, and reduces CPU or memory when the load is below.
- B. The Horizontal Pod Autoscaler controller adds more pods when the load is above the configured threshold, but does not reduce the number of pods when the load is below.
- C. The Horizontal Pod Autoscaler controller adds more pods to the specified DaemonSet when the load is above the configured threshold, and reduces the number of pods when the load is below.
- D. The Horizontal Pod Autoscaler controller adds more pods when the load is above the configured threshold, and reduces the number of pods when the load is below.
Correct answer: D
Explanation
The correct answer is D, as the Horizontal Pod Autoscaler is designed to dynamically adjust the number of pods based on the load conditions, increasing the pod count when load exceeds the specified threshold and decreasing it when load falls below. Options A and B incorrectly describe the function of adjusting CPU or memory instead of pod count, while option C misattributes the autoscaling functionality to a DaemonSet, which is not applicable in this context.