Kubernetes automatic shutdown after some idle time

5/11/2018

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

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

-- user1595858
kubernetes
kubernetes-helm

1 Answer

5/11/2018

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.

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.

This functionality relies on performance metrics provided by Heapster 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.

The mentioned Kubernetes feature called HPA(horizontal pod autoscale) is described in this document.

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.

More information about this functionality can be found following the link.

If you decide to give it a try, you might find this information useful:

-- VAS
Source: StackOverflow