IT lexicon › Infra & Ops › Horizontal Pod Autoscaler (HPA)

Horizontal Pod Autoscaler (HPA)

Infra & Ops På svenska → Updated: 2026-05-29

A Kubernetes mechanism that automatically adjusts the NUMBER of pod replicas based on load — e.g. CPU, memory, or custom metrics. It scales out (more pods) under high load and in (fewer) under low. The most common autoscaling tool in Kubernetes.

Mechanic: the HPA compares an observed metric (say average CPU across the pods) against a target and computes how many replicas are needed to hit the target, then adjusts the deployment/statefulset's replica count. It supports CPU/memory (via metrics-server) and custom/external metrics (via adapters — e.g. queue length, requests/sec). Win: handle traffic spikes automatically and save money when it's quiet. Trade-off: it requires sensible resource requests (the HPA computes against them), and overly aggressive scaling can cause "flapping". Distinct from the VPA (which changes each pod's size, not the count) and the cluster autoscaler (which adds nodes). The three are often combined. A cornerstone of elastic operations. Related to vertical pod autoscaler and resource requests/limits.

← Back to the lexicon