<p>I have a GKE cluster that I want to have sitting at 0 nodes, scale up to 3 nodes to perform a task, and then after a certain amount of idle time, scale back down to 0. Is there a way to do this?</p>

<p>A GKE cluster can never scale down to 0 because of the system pods running in the cluster. The pods running in the kube-system namespace count against resource usage in your nodes thus the autoscaler will never make the decision to scale the entire cluster down to 0</p>

<p>It is definitely possible to have individual node pools scale down to 0 though.
You may want to consider using 2 different node pools: 1 small one to hold all the system pods (minus daemonset pods) and another larger pool with autoscaling enabled from 0 to X. You can add a taint to this node pool to ensure system pods don't use it. </p>

<p>This will minimize your resource usage during down times, but there is no way to ensure k8s automatically resizes to 0</p>

<p>An alternative, if you have a planned schedule for when the cluster should scale up or down, you can leverage <a href="https://cloud.google.com/scheduler/docs/quickstart" rel="nofollow noreferrer">Cloud Scheduler</a> to launch a job that sends an API call to the container API to resize your cluster. </p>

<p>Or you could configure a job in the cluster or a prestop hook in your final job to trigger a <a href="https://cloud.google.com/functions/docs/writing/" rel="nofollow noreferrer">Cloud Function</a></p>
