Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kubernetes automatic shutdown after some idle time

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.

like image 819
user1595858 Avatar asked Oct 28 '25 04:10

user1595858


1 Answers

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:

  • Creating a Container cluster in GKE
  • 70% cheaper Kubernetes cluster on AWS
  • How to build a Kubernetes Horizontal Pod Autoscaler using custom metrics
like image 173
VASャ Avatar answered Oct 30 '25 03:10

VASャ



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!