A controller that adjusts replica count so the measured metric stays near a configured target.

The Horizontal Pod Autoscaler scales by a target utilization

Because it can act on the mean of a series instead of a single spike, you need to pair it with a max-rc that keeps the maths from running forever. A smoothed average decides The HPA does not react to a single instantaneous read; it averages the observed value over a window and smooths it before comparing against the target. That is deliberate: a one-second spike in a metric should not repaint the replica count, so the controller aggregates first, then only changes the count when the smoothed value moves past the target. To make that work you choose the metric source (CPU, custom metrics API, or external) and the target, because the smoothing window and the aggregation method, per-pod average versus cluster level, together define what ’the load’ actually is. A metric read over too short a window reacts to noise; too long and it lags demand. Reading the document’s sync-period and aggregation paragraph is the first step in tuning, not the last. ...

December 22, 2027 · 5 min · XB Field Notes
A controller that resizes a workload's replica count from a target metric.

The horizontal autoscaler scales on demand

The autoscaler derives desired replicas from current usage and a target, so the metric you choose matters more than the replica count you set. Metrics drive the count The HPA does not watch load directly; it polls a configured metric on a schedule, reads a current value against the target you set, and derives a desired replica count from the ratio. If the observed value runs twice the target it scales up, if half it scales down, and the result is recomputed on each reconciliation. That is why the metric choice, its aggregation (per pod or cluster-level), and the window matter, they define what the load even is. The desired count is then clamped by maxReplicas and minReplicas, and reconciled on the default --horizontal-pod-autoscaler-sync-period. To make scaling predictable you reason about the input metric, not about a single constant. ...

November 4, 2027 · 5 min · XB Field Notes