Introduction
In this post, we are going to study Autoscaling pods in Kubernetes and their types, to understand Auto scaling first we need to know what is Scaling
So Scaling / Scalability is defined as the ability to handle a growing number of Customers, clients, users and requests etc.
In our case, we are talking about Scalability in terms of handling the Increased or decreased workload on demand of the system and application
As the load Increases on the app, it can be able to manage the load by Scaling it up by expanding its memory or Cpu resources or just by creating Multiple replicas as per our configuration and the same goes for scaling down when the load gets decreases by reducing the memory and CPU resources or by deleting the replicas
Types of scaling
Horizontal
Horizontal Scaling is done by adding more replicas of the same application if one app is not able to compute all the requests than by scaling it Horizontally that is by creating more replicas as per the need it can be used to serve the increased request and the request gets normal it can delete the extra replicas
It can be done with the help of an HPA file which is also known as Horizontal Pod Autoscaler where we can config the minimum and Maximum replicas and scale whenever it reaches a certain threshold for eg: target CPU utilization: 70%
vertical
Vertical Scaling is done by expanding the server in which the apps are running it's like expanding the resources of the server by increasing its Memory and Cpu as per the required need and decreasing it when the request gets back to normal instead of Creating multiple replicas vertically scaling helps to expand the Current server in which the apps are already running and helps to manage the overall request on the server
It can Increase/Vertically decrease the Memory and Cpu by expanding the server
Horizontal Pod auto scaler helps to define the minimum and maximum CPU and memory it should allocate to the app and the rest things are handled by HPA
It enables kubernetus to allocate resources properly
Benefits of Autoscaling
Helps to use the Server resources in an effective manner
Cost optimization for Cloud-based servers
Allocating the needed resources wherever required
Prevents Excessive use of Cost and Resources etc.
Conclusion
Thus we have studied Autoscaling in Kubernetes hope you have got some knowledge from this post and you will use it in your projects to learn more about it and get your hands dirty by trying it out.
You can also check out some important links
https://kubernetes.io/blog/2016/07/autoscaling-in-kubernetes/