{"id":6235,"date":"2022-10-27T10:06:58","date_gmt":"2022-10-27T09:06:58","guid":{"rendered":"https:\/\/cloudification.io\/2022\/10\/27\/minikube-copy\/"},"modified":"2025-01-08T17:27:14","modified_gmt":"2025-01-08T16:27:14","slug":"kubernetes-autoscaling-autoscaler-types","status":"publish","type":"post","link":"https:\/\/cloudification.io\/de\/cloud-blog\/kubernetes-autoscaling-autoscaler-types\/","title":{"rendered":"Kubernetes Autoscaling"},"content":{"rendered":"
Kubernetes is a versatile system that lets you automate many management tasks, this includes provisioning and scaling of both workloads and underlying infrastructure. Scalability is one of the main features of Kubernetes.<\/span><\/p> Managing a Kubernetes cluster is no easy task. The larger the cluster, the larger the number of deployed pods needed to spread the load on the system. This constitutes two types of problems, you can either run out of nodes to host those pods, or have too many that are unused whenever the load decreases.<\/span><\/p> Automating scaling can help you with these problems, since it is a lot quicker than having to manually allocate resources, add or remove nodes. Automation allows you to respond quicker to peaks in demand, and reduce costs by scaling down when resources are not needed.<\/span><\/p> Understanding the different types of Autoscalers is crucial for getting the most out of your Kubernetes platform.<\/span> Let\u2019s dive into it!<\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t There are three types of autoscaling available in Kubernetes, two of them are pod-based and one is node-based:<\/span><\/p> \u00a0<\/p> Basically there are three ways in which Kubernetes can autoscale and these are either by adjusting the capacity of pods (<\/span>vertical autoscaling<\/span><\/i>), by adjusting the number of pod replicas (<\/span>horizontal autoscaling<\/span><\/i>), and\/or by adding or removing nodes in a cluster (<\/span>cluster autoscaling<\/span><\/i>).\u00a0<\/span><\/p> When combined, these three dimensions offer great benefits, such as that services run with high stability while at maximum load, and at the same time minimizing costs when the demand is low.<\/span><\/p> There is a delicate balance to be kept between maintaining an efficient performance and avoiding overprovisioning.<\/span><\/p> Let\u2019s take a look at each of these approaches in detail:<\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t The VPA is a component you install in your cluster. It can increase or decrease the request and limit of a pod\u2019s CPU and memory in relation to the actual workload. When the workload demand increases, the VPA will increase the resource limits for a pod and conversely, the VPA will decrease the resource limits as the workload demand decreases. These adjustments are based on historical resource usage measurements.<\/span><\/p> A correct implementation of this tool will ensure that the resources of a Kubernetes cluster are allocated efficiently and automatically.\u00a0<\/span><\/p> With VPA you can configure two types of resources, namely <\/span>requests <\/b>und <\/span>limits<\/b>. The former sets the minimum amount of resourcer that a container needs, while the latter defines the maximum amount of resources that a container can use, preventing it from consuming more than the amount you have previously set. <\/span>Kubernetes scheduler will take care of arranging the pods in cluster based on their requests.<\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t VPA Recommender:<\/b><\/p> VPA Updater:<\/b><\/p> VPA Admission Controller:<\/b><\/p> You can choose to either configure the VPA or to run it in recommendation mode.<\/span><\/p> With the <\/span>recommendation mode<\/b>, the VPA Recommender updates the status field of the workload\u2019s Vertical Pod Autoscaler resource with its suggested values. It however, does not terminate pods or alter pod API requests.\u00a0<\/span><\/p> If you choose to <\/span>configure the VPA<\/b>, this is what happens:<\/span><\/p>
<\/span><\/p>Types of AutoScalers\n<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t
<\/span><\/li>
<\/span><\/li><\/ul><\/li>1. Vertical Pod Autoscaler (VPA)\n<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t
VPA Components \n\n<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t
How does it work?\n<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\tLimitations<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t
Best Practices\n<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t