kubectl scale

Deployment, ReplicaSet StatefulSet

Syntax

kubectl scale <resource> <name> --replicas=<count> [flags]

Parameters

ParametersDescriptionExamplesLevel
--replicas kubectl scale deployment web --replicas=5 Common
--current-replicas : kubectl scale deployment web --current-replicas=3 --replicas=5 Advanced
--timeout and more kubectl scale deployment web --replicas=10 --timeout=60s Advanced

Examples

5

kubectl scale deployment web-app --replicas=5

1

kubectl scale deployment web-app --replicas=1

0()

kubectl scale deployment web-app --replicas=0
Deployment Pod

kubectl scale deployment web-app --current-replicas=3 --replicas=5
3 5,

Common Errors

the server could not find the requested resourcescale(Deployment/ReplicaSet/StatefulSet)
cannot scale a resource that doesn't existand

Tips

Related Commands