Scaling
Scale replicas manually and automatically based on real signals.
What you will be able to do
- Set resource requests before HPA.
- Use HPA for variable traffic.
- Scale on the right metric.
- Keep stateless pods for easy scaling.
In plain English
Horizontal Pod Autoscaler adds replicas when CPU or custom metrics exceed targets. It needs resource requests to calculate utilisation. Scale on the signal that actually limits you, not just CPU.
kubectl autoscale deployment web --cpu-percent=60 --min=2 --max=10
kubectl get hpa
kubectl top podsYour turn
MediumCreate an autoscaler
Write a command to autoscale web between 2 and 10 replicas at 60% CPU.
BASH · starter
kubectl autoscaleCheck your understanding before moving on.
Knowledge checkQuestion 1
What does HPA need in order to scale on CPU?
Select an answer to continue
Study tools
Make it yours.
Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.
Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign inFinished reading?
Lock in what you just learned.
0%
Mark this lesson complete to save your place and move one step closer to the certificate.