← Simulation Lab

☸️ Autoscale pods on Kubernetes

Software & Cloud

The Horizontal Pod Autoscaler adds pods to keep CPU near a target. Pick the pod CPU request, the target and the node size so traffic is served with headroom at a sensible monthly bill.

⭐ Level 1: Trainee0 XP · next level at 300
🎯 1,000 req/s at 20 m each: serve it with 40 pods or fewer, keeping the target at 70% or less.
Controls
Results
CPU needed20,000 m
Pods160
Pods per node✓ 14
Nodes12
Monthly cost₹33,600

Serves the traffic with headroom.

📘 How it works

The autoscaler watches CPU against what each pod requested. A low target wastes money; a very high one leaves no room for a spike while new pods start. Pod size also matters: pods that do not divide a node evenly leave CPU stranded.

pods = ⌈req/s × CPU per request ÷ (request × target)⌉ · pods per node = ⌊node CPU × 0.9 ÷ request⌋A simplified textbook model for learning. Real designs follow the full codes and standards.