Question

Does scaling down deployments help saving on billing?

Posted March 6, 2020 913 views
Kubernetes

Does scale down deployments outside business hours help saving on billing?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
3 answers

It depends on what you’re scaling down. As @bobbyiliev said, if you’re reducing the number of nodes in your cluster, that will but down your bill.

But if you’re just reducing the number of replicas of your deployment (which is what it sounds like you’re implying), then the number of nodes (virtual machines) that you’re running is the same, and it will NOT bring your bill down.

  • ok, yes this is what I’m doing.
    Thank you!

  • Is it possible to downscale nodes to 0?

    • I’m not sure if it’s possible to have a zero-node cluster. But I think you should always keep at least one node in your cluster. It could be the cheapest possible VM ($10/month).

      You could try organizing your cluster as follows:

      • Create a kubernetes cluster with a pool consisting of 1 small node. This will be your “permanent pool” that you never kill.
      • During business hours, add a pool with the number of nodes you need for your application. Deploy your application to that pool.
      • At the end of business hours, delete your deployment and then delete the pool.
      • Repeat this process every day.

      To be honest, unless you really have a very large workload during the day and then no workload during the night, this is probably not worth the effort of saving $10/$20 a month.

      If you DO have such a large workload, I’d be very curious to learn more about it.

      You might just be using the wrong tool for the job, and something other than Kubernetes will be more effective.

    • Hi there @xenon90,

      I’ve just tried creating a new Kubernetes cluster and tried to set the nodes to 0 and I can confirm that it is not possible to have 0 nodes. Also, the recommended minimum is 2 nodes, that way if one of the nodes goes down you still would have a running instance.

      In addition to what @nabsul mentioned, what I could also suggest is rather than doing this manually you could enable the Cluster Autoscaler for a DigitalOcean Kubernetes Cluster.

      You could take a look at the documentation here on how to do that:

      https://www.digitalocean.com/docs/kubernetes/how-to/autoscale/

      Hope that this helps!
      Regards,
      Bobby

Hi there @xenon90,

Yes, I believe that this should be the case as you would not be paying for the extra Kubernetes Nodes during the night.

Hope that this helps!
Regards,
Bobby

Thank you very much for your answers!

Submit an Answer