Configuring the max number of pods for a node on GKE

10/2/2019

I'm having some trouble configuring my deployments on GKE.

I want to decrease the default(110) number of pods allowed on a node and I can't do it through the console. I read that the max number of pods can be set by kubelet --max-pods=<int32> however I don't know how to do this with GKE.

Any help is much appreciated.

-- limeeattack
cloud
cluster-computing
docker
google-kubernetes-engine
kubernetes

1 Answer

10/2/2019

The kubelet --max-pods=<int32> approach you mentioned is actually deprecated as per the Kubernetes documentation:

This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ for more information.

However, in Google Kubernetes Engine, you can modify this by going to the Developer Console > Kubernetes Engine > Clusters, click on your cluster's name and click on Add Node Pool at the top. You'll be able to set a maximum number of pods per node for that new node pool.

Once done, you'll be able to deploy your services to specific node pools by following the instructions here.

-- LundinCast
Source: StackOverflow