Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to increase PODS in Kubernetes

I'm very new to Kubernetes, I have deployed a cluster on Kubernetes. Created a deployment and set POD's count to 2. I didn't create HPA for this deployment.

I'm using Google Cloud for this. I enabled autoscaling for the cluster. min is 2 and max is 30.

I got the OOMKilled error in my deployment.

So the question is

So only HPA can increase/decrease PODS count am I right ??. In that case, HPA based on memory and CPU is a must and should for every deployment.

Please correct me if I'm wrong.

like image 427
Rams Avatar asked Jan 23 '18 14:01

Rams


1 Answers

You can use kubectl to change the number of pods running:

kubectl scale deployment <DEPLOYMENT NAME> --replicas=<#PODS>
kubectl scale deployment student-app --replicas=2

You can find more info at the docs page

like image 61
Erez Rabih Avatar answered Oct 24 '22 02:10

Erez Rabih