2

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?

Grzenio
  • 35,875
  • 47
  • 158
  • 240
malcolm
  • 458
  • 5
  • 14

2 Answers2

0

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
  • 4,603
  • 1
  • 12
  • 26
  • Yes, I understand it. But how to convert? Please, show the example. I am not specialist in js... – malcolm Apr 02 '19 at 10:00
  • That I'm not 100% sure of. Alternatively, you could run a Cron job somewhere else that runs the gcloud command to resize your node pool It's not as elegant but much easier to handle if you're not good with js – Patrick W Apr 02 '19 at 18:38
0

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
  • 2,587
  • 3
  • 27
  • 43