Resizing instance groups by schedule

4/1/2019

I have kubernetes cluster that contains two node pools. I have a task to automate resizing node pools to 0 nodes on weekends to save the money. I know that I can stop the compute instances by standard schedule. But I can't stop the instances that are members of instance pools. I can only resize the pool to 0. How can I do that by gcloud schedule?

-- malcolm
google-compute-engine
google-kubernetes-engine
kubernetes

2 Answers

4/3/2019

Here are some possible solutions:

If you want automation, you can use Jenkins or Airflow to schedule resizing jobs.

Hope this can help you.

-- howie
Source: StackOverflow

4/2/2019

Cloud scheduler won't allow you to resize the node pool. You can instead use Cloud scheduler along with Cloud Functions to call the container API to resize the node pool. There is an example on the Google public docs to do something like this for a compute instance, you'll have to convert the function call to use the container API instead.

-- Patrick W
Source: StackOverflow