CCE Cluster Autoscaler
Introduction
Autoscaler is an important Kubernetes controller. It supports microservice scaling and is key to serverless design.
When the CPU or memory usage of a microservice is too high, horizontal pod autoscaling is triggered to add pods to reduce the load. These pods can be automatically reduced when the load is low, allowing the microservice to run as efficiently as possible.
CCE simplifies the creation, upgrade, and manual scaling of Kubernetes clusters, in which traffic loads change over time. To balance resource usage and workload performance of nodes, Kubernetes introduces the Autoscaler add-on to automatically adjust the number of nodes a cluster based on the resource usage required for workloads deployed in the cluster. For details, see Creating a Node Scaling Policy.
Open source community: https://github.com/kubernetes/autoscaler
How the Add-on Works
Autoscaler controls auto scale-out and scale-in.
- Auto scale-out
You can choose either of the following methods:
- If a pod cannot be scheduled due to insufficient resources of worker nodes, CCE will add more nodes to the cluster. The new nodes have the same resource quotas as those configured for the node pools that the new nodes are in.
Auto scale-out will be performed when:
- Node resources are insufficient.
- No node affinity policy is set in the scheduling configurations of the pod. If the pod is configured affinity for a node, the system will not automatically add more nodes in the cluster. For details about how to configure node affinity policies, see Configuring Node Affinity Scheduling (nodeAffinity).
- When the cluster meets the node scaling policy, cluster scale-out is also triggered. For details, see Creating a Node Scaling Policy.
The add-on follows the "No Less, No More" policy. For example, if three cores are required for creating a pod and the system supports four-core and eight-core nodes, Autoscaler will preferentially create a four-core node.
- If a pod cannot be scheduled due to insufficient resources of worker nodes, CCE will add more nodes to the cluster. The new nodes have the same resource quotas as those configured for the node pools that the new nodes are in.
- Auto scale-in
When a cluster node is idle for a period of time (10 minutes by default), cluster scale-in is triggered, and the node is automatically deleted. However, a node cannot be deleted from a cluster if the following pods exist:
- Pods that do not meet specific requirements set in Pod Disruption Budgets (PodDisruptionBudget)
- Pods that cannot be scheduled to other nodes due to constraints such as affinity and anti-affinity policies
- Pods that have the cluster-autoscaler.kubernetes.io/safe-to-evict: 'false' annotation
- Pods (except those created by DaemonSets in the kube-system namespace) that exist in the kube-system namespace on the node
- Pods that are not created by the controller (Deployment/ReplicaSet/job/StatefulSet)
When a node meets the scale-in conditions, Autoscaler adds the DeletionCandidateOfClusterAutoscaler taint to the node in advance to prevent pods from being scheduled to the node. After the Autoscaler add-on is uninstalled, if the taint still exists on the node, manually delete it.
Notes and Constraints
- Ensure that there are sufficient resources for installing the add-on.
- The default node pool does not support auto scaling. For details, see Description of DefaultPool.
- When Autoscaler is used, some taints or annotations may affect auto scaling. Therefore, do not use the following taints or annotations in clusters:
- ignore-taint.cluster-autoscaler.kubernetes.io: The taint works on nodes. Kubernetes-native Autoscaler supports protection against abnormal scale outs and periodically evaluates the proportion of available nodes in the cluster. When the proportion of non-ready nodes exceeds 45%, protection will be triggered. In this case, all nodes with the ignore-taint.cluster-autoscaler.kubernetes.io taint in the cluster are filtered out from the Autoscaler template and recorded as non-ready nodes, which affects cluster scaling.
- cluster-autoscaler.kubernetes.io/enable-ds-eviction: The annotation works on pods, which determines whether DaemonSet pods can be evicted by Autoscaler. For details, see Well-Known Labels, Annotations and Taints.
Installing the Add-on
- Log in to the CCE console and click the cluster name to access the cluster console. In the navigation pane, choose Add-ons, locate CCE Cluster Autoscaler on the right, and click Install.
- On the Install Add-on page, configure the specifications as needed.
There are three types of preset specifications based on the cluster scale. You can select one as required. The system will configure the number of pods and resource quotas for the add-on based on the selected preset specifications. You can see the configurations on the console.
- Configure deployment policies for the add-on pods.
- Scheduling policies do not take effect on add-on instances of the DaemonSet type.
- When configuring multi-AZ deployment or node affinity, ensure that there are nodes meeting the scheduling policy and that resources are sufficient in the cluster. Otherwise, the add-on cannot run.
Table 1 Configurations for add-on scheduling Parameter
Description
Multi AZ
- Preferred: Deployment pods of the add-on will be preferentially scheduled to nodes in different AZs. If all the nodes in the cluster are deployed in the same AZ, the pods will be scheduled to different nodes in that AZ.
- Equivalent mode: Deployment pods of the add-on are evenly scheduled to the nodes in the cluster in each AZ. If a new AZ is added, you are advised to increase add-on pods for cross-AZ HA deployment. With the Equivalent multi-AZ deployment, the difference between the number of add-on pods in different AZs will be less than or equal to 1. If resources in one of the AZs are insufficient, pods cannot be scheduled to that AZ.
- Required: Deployment pods of the add-on are forcibly scheduled to nodes in different AZs. There can be at most one pod in each AZ. If nodes in a cluster are not in different AZs, some add-on pods cannot run properly. If a node is faulty, add-on pods on it may fail to be migrated.
Node Affinity
- Not configured: Node affinity is disabled for the add-on.
- Node Affinity: Specify the nodes where the add-on is deployed. If you do not specify the nodes, the add-on will be randomly scheduled based on the default cluster scheduling policy.
- Specified Node Pool Scheduling: Specify the node pool where the add-on is deployed. If you do not specify the node pool, the add-on will be randomly scheduled based on the default cluster scheduling policy.
- Custom Policies: Enter the labels of the nodes where the add-on is to be deployed for more flexible scheduling policies. If you do not specify node labels, the add-on will be randomly scheduled based on the default cluster scheduling policy.
If multiple custom affinity policies are configured, ensure that there are nodes that meet all the affinity policies in the cluster. Otherwise, the add-on cannot run.
Toleration
Using both taints and tolerations allows (not forcibly) the add-on Deployment to be scheduled to a node with the matching taints, and controls the Deployment eviction policies after the node where the Deployment is located is tainted.
The add-on adds the default tolerance policy for the node.kubernetes.io/not-ready and node.kubernetes.io/unreachable taints, respectively. The tolerance time window is 60s.
For details, see Configuring Tolerance Policies.
- After the configuration is complete, click Install.
Components
Component |
Description |
Resource Type |
---|---|---|
Autoscaler |
Auto scaling for Kubernetes clusters |
Deployment |
Change History
Add-on Version |
Supported Cluster Version |
New Feature |
Community Version |
---|---|---|---|
1.29.17 |
v1.29 |
Optimized events. |
|
1.29.13 |
v1.29 |
Clusters 1.29 are supported. |
Add-on Version |
Supported Cluster Version |
New Feature |
Community Version |
---|---|---|---|
1.28.55 |
v1.28 |
Optimized events. |
|
1.28.51 |
v1.28 |
Optimized the logic for generating alarms when resources in a bode pool are sold out. |
|
1.28.22 |
v1.28 |
Fixed some issues. |
|
1.28.20 |
v1.28 |
Fixed some issues. |
|
1.28.17 |
v1.28 |
Fixed the issue that scale-in cannot be performed when there are custom pod controllers in a cluster. |
Add-on Version |
Supported Cluster Version |
New Feature |
Community Version |
---|---|---|---|
1.27.88 |
v1.27 |
Optimized events. |
|
1.27.84 |
v1.27 |
Optimized the logic for generating alarms when resources in a bode pool are sold out. |
|
1.27.55 |
v1.27 |
Fixed some issues. |
|
1.27.51 |
v1.27 |
Fixed some issues. |
|
1.27.14 |
v1.27 |
Fixed the scale-in failure of nodes of different specifications in the same node pool and unexpected PreferNoSchedule taint issues. |
Add-on Version |
Supported Cluster Version |
New Feature |
Community Version |
---|---|---|---|
1.25.120 |
v1.25 |
Optimized events. |
|
1.25.116 |
v1.25 |
Optimized the logic for generating alarms when resources in a bode pool are sold out. |
|
1.25.88 |
v1.25 |
Fixed some issues. |
|
1.25.84 |
v1.25 |
Fixed some issues. |
|
1.25.34 |
v1.25 |
|
|
1.25.21 |
v1.25 |
|
|
1.25.11 |
v1.25 |
|
|
1.25.7 |
v1.25 |
|
Add-on Version |
Supported Cluster Version |
New Feature |
Community Version |
---|---|---|---|
1.23.125 |
v1.23 |
Optimized events. |
|
1.23.121 |
1.23 |
Optimized the logic for generating alarms when resources in a bode pool are sold out. |
|
1.23.95 |
v1.23 |
Fixed some issues. |
|
1.23.91 |
v1.23 |
Fixed some issues. |
|
1.23.54 |
v1.23 |
Fixed the scale-in failure of nodes of different specifications in the same node pool and unexpected PreferNoSchedule taint issues. |
|
1.23.44 |
v1.23 |
|
|
1.23.31 |
v1.23 |
|
|
1.23.21 |
v1.23 |
|
|
1.23.17 |
v1.23 |
|
|
1.23.10 |
v1.23 |
|
|
1.23.9 |
v1.23 |
Added the nodenetworkconfigs.crd.yangtse.cni resource object permission. |
|
1.23.8 |
v1.23 |
Fixed the issue that scale-out fails when the number of nodes to be added at a time exceeds the upper limit in periodic scale-outs. |
|
1.23.7 |
v1.23 |
||
1.23.3 |
v1.23 |
CCE clusters 1.23 are supported. |
Add-on Version |
Supported Cluster Version |
New Feature |
Community Version |
---|---|---|---|
1.21.114 |
v1.21 |
Optimized the logic for generating alarms when resources in a bode pool are sold out. |
|
1.21.89 |
v1.21 |
Fixed some issues. |
|
1.21.86 |
v1.21 |
Fixed the issue that the node pool auto scaling cannot meet expectations after AZ topology constraints are configured for nodes. |
|
1.21.51 |
v1.21 |
Fixed the scale-in failure of nodes of different specifications in the same node pool and unexpected PreferNoSchedule taint issues. |
|
1.21.43 |
v1.21 |
|
|
1.21.29 |
v1.21 |
|
|
1.21.20 |
v1.21 |
|
|
1.21.16 |
v1.21 |
|
|
1.21.9 |
v1.21 |
|
|
1.21.8 |
v1.21 |
Added the nodenetworkconfigs.crd.yangtse.cni resource object permission. |
|
1.21.6 |
v1.21 |
Fixed the issue that authentication fails due to incorrect signature in the add-on request retries. |
|
1.21.4 |
v1.21 |
Fixed the issue that authentication fails due to incorrect signature in the add-on request retries. |
|
1.21.2 |
v1.21 |
Fixed the issue that auto scaling may be blocked due to a failure in deleting an unregistered node. |
|
1.21.1 |
v1.21 |
Fixed the issue that the node pool modification in the existing periodic auto scaling rule does not take effect. |
Add-on Version |
Supported Cluster Version |
New Feature |
Community Version |
---|---|---|---|
1.19.56 |
v1.19 |
Fixed the scale-in failure of nodes of different specifications in the same node pool and unexpected PreferNoSchedule taint issues. |
|
1.19.48 |
v1.19 |
|
|
1.19.35 |
v1.19 |
|
|
1.19.27 |
v1.19 |
|
|
1.19.22 |
v1.19 |
|
|
1.19.14 |
v1.19 |
|
|
1.19.13 |
v1.19 |
Fixed the issue that scale-out fails when the number of nodes to be added at a time exceeds the upper limit in periodic scale-outs. |
|
1.19.12 |
v1.19 |
Fixed the issue that authentication fails due to incorrect signature in the add-on request retries. |
|
1.19.11 |
v1.19 |
Fixed the issue that authentication fails due to incorrect signature in the add-on request retries. |
|
1.19.9 |
v1.19 |
Fixed the issue that auto scaling may be blocked due to a failure in deleting an unregistered node. |
|
1.19.8 |
v1.19 |
Fixed the issue that the node pool modification in the existing periodic auto scaling rule does not take effect. |
|
1.19.7 |
v1.19 |
Regular upgrade of add-on dependencies |
|
1.19.6 |
v1.19 |
Fixed the issue that repeated scale-out is triggered when taints are asynchronously updated. |
|
1.19.3 |
v1.19 |
Supports scheduled scaling policies based on the total number of nodes, CPU limit, and memory limit. Fixes other functional defects. |
Add-on Version |
Supported Cluster Version |
New Feature |
Community Version |
---|---|---|---|
1.17.27 |
v1.17 |
|
|
1.17.22 |
v1.17 |
Optimized logging. |
|
1.17.21 |
v1.17 |
Fixed the issue that scale-out fails when the number of nodes to be added at a time exceeds the upper limit in periodic scale-outs. |
|
1.17.19 |
v1.17 |
Fixed the issue that authentication fails due to incorrect signature in the add-on request retries. |
|
1.17.17 |
v1.17 |
Fixed the issue that auto scaling may be blocked due to a failure in deleting an unregistered node. |
|
1.17.16 |
v1.17 |
Fixed the issue that the node pool modification in the existing periodic auto scaling rule does not take effect. |
|
1.17.15 |
v1.17 |
Unified resource specification configuration unit. |
|
1.17.14 |
v1.17 |
Fixed the issue that repeated scale-out is triggered when taints are asynchronously updated. |
|
1.17.8 |
v1.17 |
Fixed bugs. |
|
1.17.7 |
v1.17 |
Added log content and fixed bugs. |
|
1.17.5 |
v1.17 |
Supported clusters 1.17 and allowed scaling events to be displayed on the CCE console. |
|
1.17.2 |
v1.17 |
Clusters 1.17 are supported. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.