π― What is HPA?
HPA automatically scales the number of pods based on observed metrics like CPU utilization, memory usage, or custom metrics.
π Scale Up Formula
desiredReplicas = ceil[currentReplicas Γ (currentValue / targetValue)]
π Scale Down Logic
Pods are scaled down when utilization falls below the Scale Down Threshold for a sustained period. This prevents rapid oscillation.
βοΈ Key Parameters
Min Replicas: Minimum pods that must always run
Max Replicas: Maximum pods the system can create
Scale Up Threshold: Utilization % that triggers scaling up
Scale Down Threshold: Utilization % that triggers scaling down
π Real-time Behavior
In this simulation, you can see HPA in action:
- Watch how utilization changes affect pod counts
- Observe the delay between scaling decisions and pod readiness
- See how min/max constraints limit scaling behavior
- Notice the difference between scale-up (formula-based) and scale-down (threshold-based) logic