How does Cluster Autoscaler scale down works in OpenShift?
Environment
- Red Hat OpenShift Container Platform (RHOCP)
- 4
- Cluster Autoscaler
Issue
- On which parameters, does the Cluster Autoscaler scale down the nodes in OCP 4?
- What settings needs to be done in Cluster Autoscaler for scaling down the nodes?
Resolution
Disclaimer: Links contained herein to external website(s) are provided for convenience only. Red Hat has not reviewed the links and is not responsible for the content or its availability. The inclusion of any link to an external website does not imply endorsement by Red Hat of the website or their entities, products or services. You agree that Red Hat is not responsible or liable for any loss or expenses that may result due to your use of (or reliance on) the external site or content.
An explanation of how the Cluster Autoscaler works is now included in the documentation: about the Cluster Autoscaler.
There is additional information of how scale-down works in the Content from github.com is not included.Cluster Autoscaler upstream FAQ. Refer also to Content from github.com is not included.the types of pods that can prevent the Cluster Autoscaler from removing a node.
Note: even if a node is currently using low CPU/Memory as shown by
oc adm top nodescommand, the Cluster Autoscaler does not check the current utilization but therequestsof all the pods in the node. Refer to the Diagnostic Steps section to check the CPU and Memoryrequestsof all pods running on the nodes.
For preventing that specific node running a specific pod to being removed, refer to how to make Cluster Autoscaler skip a node for scale down.
Root Cause
The information about how the Cluster Autoscaler works is now included in the documentation.
Diagnostic Steps
-
Check if
sumof CPU and Memoryrequestsof all pods running on the nodes is smaller than50%of the node'sallocatable:$ oc describe node <node-name> -
Refer to Cluster Autoscaler is not scaling down nodes in OCP 4 for checking the Cluster Autoscaler logs. It could be required to increase the verbosity or log level of the Cluster Autoscaler if additional information from the logs is needed.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.