Increasing predefine 4 Core CPUs of a node pool cluster in Google Kubernetes Engine(GKE)

9/30/2021

I have a cluster which has 3 nodes and each node has been allocated 4 core CPUs(3.92 to be precise). I have a nexus repository in one of my nodes which requires a minimum of 4 Core CPUs and this node is unable to allocate 4CPUs. Hence, I am only able to allocate only 3 CPUs for nexus repository in that. Could anyone tell me how to edit the cluster to update the 4 core CPUs allocated for nodes to 6 core CPUs or is there any other solution to it?

Note: I have already tried increasing the nodes in cluster but it is not working.

Thanks in advance.

-- StackOverflow Asker
google-kubernetes-engine
kubernetes
kubernetes-pod

1 Answer

10/1/2021

You cannot actually change the CPU/Mem for a node pool.

You have two options:

1) Create a new node pool with the new node CPU/Mem sizes. You'll then need to migrate your workloads to the new node pool. You can follow https://cloud.google.com/kubernetes-engine/docs/tutorials/migrating-node-pool to do this.

2) Alternatively, you can also enable node auto-provisioning for your cluster and it will automatically add new right-sized node(s) based on your pod spec(s).

gcloud container clusters update CLUSTER_NAME \\\
    --enable-autoprovisioning \\\
    --min-cpu MINIMUM_CPU \\\
    --min-memory MIMIMUM_MEMORY \\\
    --max-cpu MAXIMUM_CPU \\\
    --max-memory MAXIMUM_MEMORY \\\
    --autoprovisioning-scopes=https://www.googleapis.com/auth/logging.write,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/devstorage.read_only
-- Gari Singh
Source: StackOverflow