Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by

What are the pros and cons using kubernetes for autoscaling?

1 Answer

0 votes
by (47.6k points)

There are many places where we use Kubernetes, it is not just used for Autoscaling. It is one of the many cool features that Kubernetes has to offer for example like Cluster Federation, Service Discovery, Rolling Updates, Auto Healing etc..

Now coming back to the actual question, Autoscaling happens at two levels in Kubernetes:-

  1. Pod Level which is controlled by Horizontal Pod Autoscaler (HPA) and Vertical Pod Autoscaler(VPA).

  2. Cluster or Node Level which is controlled by Cluster Autoscaler.

Horizontal Pod Autoscaler:-

It automatically scales the number of pods in a deployment or replica set based on observed CPU or memory utilization so that you can autoscale based on custom metrics like requests/sec.

Vertical Pod Autoscaler(VPA):-

VPA frees the users from the necessity of setting up-to-date resource requests for the containers in their pods. When configured, it will set the requests automatically based on usage and thus allow proper scheduling onto nodes so that appropriate resource amount is available for each pod.

Cluster Autoscaler:-

Cluster Autoscaler automatically resizes clusters based on the demands of the workloads you want to run. It automatically adds a new node to your cluster if you've created new Pods that don't have enough capacity to run; conversely, if a node in your cluster is underutilized and its Pods can be run on other nodes, Cluster Autoscaler can delete the node. To learn more on how to scale up and scale down happens in Kubernetes read this Kubernetes Tutorial.

Now talking about the Pros and Cons of using Kubernetes for autoscaling is as follows:-

Pros:

  • The biggest advantage of using Kubernetes for autoscaling is, it reduces the cost. You do not need to guess the number of nodes or pods needed to run your workloads. It scales up or down dynamically based on resource utilization, thus saving you dollars.

Cons:

  • Sometimes it may happen that very few pods are running on the node and still scale down may not happen because Cluster Autoscaler needs all these (see how scale down works section of this article) conditions to be satisfied before scaling down.

If you want to have a certification in Kubernetes then you can take up the Kubernetes Training Course. Do have a look at the following video in which will give you all the insights about Kubernetes.

.

Browse Categories

...