Srikanth Aawula
Srikanth Aawula

Reputation: 1

How can I increase the number of pods in kubernetes

I want to increase the number of pods in kubernetes for which I'm trying with the following commands but which gives an error Error from server (NotFound): deployments.apps not found

kubectl scale deployment <pod> --replicas=4

Upvotes: 0

Views: 811

Answers (2)

Faizan
Faizan

Reputation: 309

You can increase/decrease the number of Pods in a deployment using:

# To kill all pods in a deployment
kubectl scale deploy <deployment-name> --replicas=0

# To set the number of pods
kubectl scale deploy <deployment-name> --replicas=3

Upvotes: 1

Harsh Manvar
Harsh Manvar

Reputation: 30208

You to pass the deployment name which you want to scale

kubectl scale deployment <deployment name>  --replicas=4

POD name wont work.

Read more here/Example

kubectl scale deployment/nginx-deployment --replicas=10

Upvotes: 2

Related Questions