<p>I have a Google Kubernetes Engine cluster that runs pods of several environments (dev, pre, pro). In order to reduce costs I would like to stop some nodes during the night, and keep only the necessary to run production pods. Then in the morning I want to upscale the nodes and start the dev/pre pods.</p>

<p><strong>Peak Hours</strong></p>

<pre><code>Node1 -&gt; ProdPod1 DevPod1
Node2 -&gt; ProdPod2 PrePod1
  .
  .
NodeN -&gt; DevPod2 ProdPod3
</code></pre>

<p><strong>Valley Hours</strong></p>

<pre><code>Node1 -&gt; ProdPod1 ProdPod2 ProdPod3
</code></pre>

<p>Does GKE provide some way of programming this downscaling/upscaling of nodes and pods? If not how could it be done?</p>

codependent
<p>The thing is, if you're arbitrarily killing <em>nodes</em>, while Kubernetes was requested to run (and is running) a specific workload utilizing specific resources, how do you expect it to know what pods to kill?<br>
(You can address this with pod priorities, but I wouldn't recommend that).</p>

<p>What you want to look at is the <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-autoscaler" rel="nofollow noreferrer">Cluster Autoscaler</a>.<br>
Just make sure to kill the dev/test workloads at night, and the auto-scaler will take care of the rest.<br>
I'd get into more detail, but this sounds extremely like a <a href="http://wiki.c2.com/?PrematureOptimization" rel="nofollow noreferrer">premature optimization</a>, so I don't recommend taking the path you're going to take unless the amount of money you'll be saving is significant, i.e., worth more than your time ;-)</p>

<p>Hope this helps!</p>
