webapp with min replicas 2 and max replicas 5, currently scaling to 3 replicas based on CPU usage?kubectl get hpa webappThe kubectl get hpa command shows the current CPU usage as the first number in TARGETS and the target CPU utilization as the second number. The REPLICAS column shows the current number of pods running.
Option A correctly shows 60% current usage against 50% target, with 3 replicas running.
The HPA will reduce the number of pods when CPU usage is below the target, but it will never go below the minimum replicas configured.
Since CPU usage is 30%, below the 50% target, the HPA will scale down to the minimum of 1 pod.
api-server with min 3 replicas, max 10 replicas, targeting 75% CPU utilization?Option D uses the autoscaling/v2 API with the correct metrics field specifying CPU utilization target.
Option D uses autoscaling/v1 which supports only CPU target but with a different field name; it is valid but less flexible.
Options C and D incorrectly target memory instead of CPU.
If maxReplicas is set to 1, the HPA cannot scale beyond one pod regardless of CPU usage.
Resource requests missing can cause inaccurate metrics but usually do not prevent scaling entirely.
Using multiple metrics like CPU and memory allows the HPA to scale pods based on the most relevant resource pressure, improving responsiveness and stability.
Relying on a single metric may cause suboptimal scaling.