Creates a scaling configuration to allow the system to scale resources based on the given scaling rules. When you create a scaling configuration, you can specify the scaling metrics, thresholds, scaling order, and scaling interval.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
cs:CreateAutoscalingConfig | create |
|
| none |
Request syntax
POST /cluster/{ClusterId}/autoscale/config/ HTTP/1.1
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ClusterId | string | Yes | The cluster ID. | c0XXXXXXX10 |
body | object | No | The request body. | |
cool_down_duration | string | No | The waiting time before the auto scaling feature performs a scale-in activity. It is an interval between the time when the scale-in threshold is reached and the time when the scale-in activity (reduce the number of pods) starts. Unit: minutes. Default value: 10. | 10 m |
unneeded_duration | string | No | The cooldown period. After the autoscaler performs a scale-out activity, the autoscaler waits a cooldown period before it can perform a scale-in activity. Newly added nodes can be removed in scale-in activities only after the cooldown period ends. Unit: minutes. | 10 m |
utilization_threshold | string | No | The scale-in threshold. This threshold specifies the ratio of the resources that are requested by pods to the total resources on the node. A scale-in activity is performed only when the CPU utilization and memory utilization of a node are lower than the scale-in threshold. | 0.5 |
gpu_utilization_threshold | string | No | The scale-in threshold of GPU utilization. This threshold specifies the ratio of the GPU resources that are requested by pods to the total GPU resources on the node. A scale-in activity is performed only when the CPU utilization, memory utilization, and GPU utilization of a GPU-accelerated node are lower than the scale-in threshold of GPU utilization. | 0.5 |
scan_interval | string | No | The interval at which the system scans for events that trigger scaling activities. Unit: seconds. Default value: 60. | 30s |
scale_down_enabled | boolean | No | Specifies whether to allow node scale-in activities. Valid values:
| true |
expander | string | No | The node pool scale-out policy. Valid values:
| least-waste |
skip_nodes_with_system_pods | boolean | No | Specifies whether the cluster autoscaler scales in nodes that host pods in the kube-system namespace. This parameter does not take effect on pods created by DaemonSets and mirror pods. Valid values:
| true |
skip_nodes_with_local_storage | boolean | No | Specifies whether the cluster autoscaler scales in nodes that host pods mounted with local volumes, such as EmptyDir or HostPath volumes. Valid values:
| false |
daemonset_eviction_for_nodes | boolean | No | Specifies whether to evict pods created by DaemonSets when the cluster autoscaler performs a scale-in activity. Valid values:
| false |
max_graceful_termination_sec | integer | No | The maximum amount of time to wait for pods on a node to terminate during a scale-in activity. Unit: seconds. | 14400s |
min_replica_count | integer | No | The minimum number of pods allowed in each ReplicaSet before a scale-in activity is performed. | 0 |
recycle_node_deletion_enabled | boolean | No | Specifies whether to delete the corresponding Kubernetes node objects after nodes are removed in swift mode. For more information about the swift mode, see Scaling mode. Default value: false. Valid values:
| false |
scale_up_from_zero | boolean | No | Specifies whether the cluster autoscaler performs a scale-out activity when the number of ready nodes in the cluster is 0. Default value: true. Valid values:
| true |
Response parameters
Examples
Sample success responses
JSON
format
{}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2023-06-02 | The internal configuration of the API is changed, but the call is not affected | View Change Details |