Bitzu

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

Single choice

What does the Horizontal Pod Autoscaler change?

  1. The CPU and memory requests of each Pod
  2. The number of nodes in the node pool
  3. The machine type of the nodes
  4. 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.

Select all that apply

Which metric sources can an HPA scale on?

  1. CPU utilization
  2. Memory usage
  3. A custom metric such as requests per second
  4. The number of namespaces in the cluster
  5. 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.

True or false

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.

Download on the App StoreGet it on Google Play

More Associate Cloud Engineer topics in this module