Bitzu

KCNA ยท Cluster administration and scheduling

Autoscaling in Kubernetes

Horizontal Pod Autoscaler, Vertical Pod Autoscaler, Cluster Autoscaler: what each scales and on which signals.

Key points

  • HorizontalPodAutoscaler (built in) changes the number of Pod replicas, using signals such as CPU utilization relative to requests, memory or custom metrics, evaluated about every 15 seconds.
  • VerticalPodAutoscaler is an add-on that adjusts the CPU and memory of Pods.
  • Cluster Autoscaler adds or removes nodes, typically when Pods cannot be scheduled for lack of capacity.
  • HPA needs a metrics source, usually Metrics Server.

Source: https://kubernetes.io/docs/concepts/workloads/autoscaling/

Practice questions

Single choice

What does the Horizontal Pod Autoscaler change?

  1. The number of Pod replicas
  2. The CPU limit of each Pod
  3. The number of nodes
  4. The size of etcd
Show answer

Answer: A. The number of Pod replicas

HPA changes the replica count of a scalable workload such as a Deployment. Changing per-Pod resources is VPA, and changing node count is Cluster Autoscaler.

Select all that apply

Which statements about the autoscalers are correct?

  1. HPA is a built-in Kubernetes feature
  2. VPA is an add-on that is not installed by default
  3. Cluster Autoscaler adds or removes nodes
  4. HPA rewrites each Pod's CPU limit
  5. HPA can scale a DaemonSet
Show answer

Answer: A. HPA is a built-in Kubernetes feature, B. VPA is an add-on that is not installed by default, C. Cluster Autoscaler adds or removes nodes

HPA is built in, VPA is an add-on that must be deployed, and Cluster Autoscaler works on node count. HPA does not rewrite per-Pod limits and cannot scale a DaemonSet.

True or false

The Vertical Pod Autoscaler ships built in with every Kubernetes cluster.

Show answer

Answer: False

False. VPA is an add-on that an administrator must deploy, and it also needs a metrics source.

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 KCNA topics in this module