How can I increase the number of pods in kubernetes

11/30/2021

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 <pod> not found

kubectl scale deployment <pod> --replicas=4
-- Srikanth Aawula
kubernetes

2 Answers

11/30/2021

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
-- Harsh Manvar
Source: StackOverflow

11/30/2021

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
-- Faizan
Source: StackOverflow