Scale Deployment using Command Line in Kubernetes - Replicas

Itacen Sabacok | Feb 11, 2022

OPTION 1

1# syntax
2kubectl scale deployment <deployment-name> --replicas=5
3kubectl scale deployment/<deployment-name> --replicas=5
4
5# if you scale replicas to 0 then it means you won't have any pod(s) anymore
6kubectl scale deployment nginx --replicas=0
7kubectl scale deployment/nginx --replicas=0

OUTPUT: deployment.apps/nginx scaled


OPTION 2

1# it pops up the editor and you can change the replicas parameter inside of deployment config
2# you can change everything inside the config file using this way
3kubectl edit deployment <deployment-name>