kubectl autoscale deployment
kubectl autoscale deployment <name> --cpu=50% --min=n --max=n
Risk: Careful
What it does
Makes a HorizontalPodAutoscaler that changes replicas from CPU use.
When to use it
Traffic goes up and down during the day.
Example
$ kubectl autoscale deployment shop --cpu=50% --min=3 --max=103 to 10 trays, aiming at half-busy CPU.
Learn it in: Scale out at lunch rush: HPA · Official docs