Horizontal Pod Autoscaler
The HPA automatically scales Pod replica counts horizontally based on CPU/memory/custom metrics, adapting to load changes.
Purpose
Auto scale with load fluctuations, optimizing resource utilization.
Mechanism
HPA periodically queries metrics (Metrics Server/custom) and computes desired replicas = ceil(current replicas * current metric / target metric). Scale-up is fast, scale-down slow (cooldown). Can target custom metrics like QPS/latency.
Use cases
- Auto scaling
- Load adaptation
- Cost optimization