DevOps & CI/CD

How the Kubernetes HPA Control Loop Works

DevOps & CI/CD diagram · made in Skemio

Flowchart tracing the Kubernetes HPA reconciliation loop from metrics polling to replica ratio calculation and scale patching.
Flowchart tracing the Kubernetes HPA reconciliation loop from metrics polling to replica ratio calculation and scale patching.

What it shows

  • HPA controller loop defaults to polling metrics every 15 seconds.
  • Scaling formula uses target ratio: ceil(currentReplicas * (current/target)).
  • Stabilization windows prevent thrashing by smoothing rapid load spikes.

The takeaway

HPA scales on desired-to-current metric ratios while stabilization windows stop destructive flapping.

More devops & ci/cd diagrams