Kubernetes HPA Calculator: Desired Replicas
For engineers tuning the Horizontal Pod Autoscaler or preparing for Kubernetes interviews. Enter the current state and target to see the replica count the HPA formula would pick and whether it scales up or down.
Close the gaps with real-world projects
Build industry projects on ByteLabs and add verified proof of your skills to your public profile.
How to use the Kubernetes HPA Calculator
- Enter the Current replicas.
- Type the Current metric value and the Target metric value, for example CPU utilisation.
- Set Min replicas and Max replicas.
- Read Desired replicas, the raw formula result and the scaling action.
An example, step by step (example only)
You enter
Current replicas 4, Current metric value 82, Target metric value 50, Min replicas 2, Max replicas 20
The tool shows
Desired replicas 7; Raw formula result 7; Clamped to min/max: within bounds; Scaling action: scale up +3
Questions about the Kubernetes HPA Calculator
What formula does the Kubernetes HPA use?
desired = ceil(current replicas x current metric / target metric), then clamped between min and max replicas. With 4 replicas at 82 against a target of 50, that gives 7.
Why did my HPA not scale when the metric was slightly above target?
The HPA ignores changes within a default tolerance of 10 percent of the target. This calculator shows the raw formula without that tolerance.
Why does HPA scale down slowly?
By default it uses a 5 minute stabilisation window for scale down to avoid flapping. Scale-up happens faster.
Is the Kubernetes HPA Calculator free and private?
Yes. It is free, needs no sign-up and runs entirely in your browser, so what you type is not uploaded. You only sign in if you want to email a result to yourself or save it to your CareerByteCode profile.