<p>Does kubernetes or Helm support shut down the pods if it is idle for more than a given threshold time?</p>

<p>This would be very useful in the development environment, to provide room for other processes to consume it and save cost. </p>

<p>Kubernetes is featured with the ability to autoscale your application in a cluster. Literally, it means that Kubernetes can start additional pods when the load is increasing and terminate excessive pods when the load is decreasing.</p>

<p>It is possible to downscale the application to zero pods, but, in this case, you will have a delay serving the first request while the pod is starting.</p>

<p>This functionality relies on performance metrics provided by <a href="https://github.com/kubernetes/heapster" rel="noreferrer">Heapster</a> application, that must be run in the cluster. From the practical side, it means that autoscaling doesn't happen instantly, because it takes some time to performance metrics reach the configured threshold.</p>

<p>The mentioned Kubernetes feature called HPA(horizontal pod autoscale) is described in this <a href="https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/" rel="noreferrer">document</a>.</p>

<p>In case you are running your cluster on GCP or GKE, you are able to go further and automatically start additional nodes for your cluster when you need more computing capacity and shut down nodes when they are not running application pods anymore.</p>

<p>More information about this functionality can be found following the <a href="https://kubernetes.io/blog/2016/07/autoscaling-in-kubernetes/" rel="noreferrer">link</a>.</p>

<p>If you decide to give it a try, you might find this information useful:</p>

<ul>
<li><a href="https://cloud.google.com/kubernetes-engine/docs/how-to/creating-a-container-cluster#create_a_cluster_with_autoscaling" rel="noreferrer">Creating a Container cluster in GKE</a>  </li>
<li><a href="https://carlosbecker.com/posts/k8s-sandbox-costs/" rel="noreferrer">70% cheaper Kubernetes cluster on AWS</a>  </li>
<li><a href="https://sysdig.com/blog/kubernetes-scaler/" rel="noreferrer">How to build a Kubernetes Horizontal Pod Autoscaler using custom metrics</a></li>
</ul>
