Associate Cloud Engineer ยท Operating GKE clusters
What do HPA, VPA and the cluster autoscaler each scale?
HPA on CPU/memory/custom metrics, VPA modes, why HPA and VPA on the same metric conflict, cluster autoscaler relationship.
Key points
- HPA changes the number of Pod replicas based on CPU, memory or custom/external metrics (it needs CPU requests for utilization targets).
- VPA changes Pod resource requests (modes Off, Initial, Recreate/Auto).
- The cluster autoscaler adds or removes nodes when Pods cannot be scheduled.
- Using HPA and VPA on CPU together needs special setups, so give them different signals.
Source: https://docs.cloud.google.com/kubernetes-engine/docs/concepts/verticalpodautoscaler
Practice questions
What does the Horizontal Pod Autoscaler change?
- The CPU and memory requests of each Pod
- The number of nodes in the node pool
- The machine type of the nodes
- The number of Pod replicas of a workload
Show answer
Answer: D. The number of Pod replicas of a workload
HPA scales out by changing the replica count. Changing requests is VPA, and changing node count is the cluster autoscaler.
Which metric sources can an HPA scale on?
- CPU utilization
- Memory usage
- A custom metric such as requests per second
- The number of namespaces in the cluster
- Storage size of an Artifact Registry repository
Show answer
Answer: A. CPU utilization, B. Memory usage, C. A custom metric such as requests per second
HPA supports resource metrics (CPU, memory) and custom or external metrics. Namespace counts and registry storage are not workload signals.
VPA in Auto mode applies new requests to running Pods without restarting them.
Show answer
Answer: False
False. In Auto (same as Recreate) VPA evicts Pods and re-creates them with new requests, so expect restarts.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
