'How to implement Auto scale on Memory based metric in EKS cluster
I have a EKS cluster with min 3 and max 6 nodes, Created auto scaling group for this setup, How can i implement auto scale of nodes when spike up/down on Memory usage since there is no such metric in Auto scaling group like cpu. Can somebody please suggest me clear steps i am new to this setup .
Solution 1:[1]
Out of the box ASG does not support scaling based on the memory utilization. You`ll have to use custom metric to do that.
Here is way how to do that.
Have you considered using CloudWatch alarms to monitor your nodes? The scripts can collect memory parameters that can be used later.
See here how to set it up.
Solution 2:[2]
I think you need Step Scaling Policy
- Target Tracking Policy; can be created for metrics where the needed capacity in proportional to the metric eg, if average CPU utilization is near or above the target value ASG will add capacity i.e. scale out.
See Considerations on https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-target-tracking.html
- Step Scaling Policy; is user controlled you create your own cloud watch alarms and decide the action and setup an inversely proportional policy, eg if average free memory is less you will want to scale out and vice versa
Solution 3:[3]
You need to deploy cluster autoscaler which will increase or decreased number of nodes for you.
See the official docs.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | acid_fuji |
Solution 2 | Anubhav Bansal |
Solution 3 | Wytrzymały Wiktor |