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 | Write |
|
| none |
Request syntax
POST /cluster/{ClusterId}/autoscale/config/
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. Only if the resource usage on a node remains below the scale-in threshold within the waiting time, the node is removed after the waiting time ends. Unit: minutes. | 10 m |
unneeded_duration | string | No | The cooldown period. 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. | 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. | 0.5 |
scan_interval | string | No | The interval at which the cluster is scanned and evaluated for scaling. Unit: seconds. | 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 to allow the cluster autoscaler to scale in nodes that host pods in the kube-system namespace, excluding DaemonSet pods and mirror pods. Valid values:
| true |
skip_nodes_with_local_storage | boolean | No | Specifies whether to allow the cluster autoscaler to scale in nodes that host pods mounted with local storage, such as EmptyDir volumes or HostPath volumes. Valid values:
| false |
daemonset_eviction_for_nodes | boolean | No | Specifies whether to evict DaemonSet pods during scale-in activities. Valid values:
| false |
max_graceful_termination_sec | integer | No | The maximum amount of time that the cluster autoscaler waits for pods on the nodes to terminate during scale-in activities. Unit: seconds. | 14400s |
min_replica_count | integer | No | The minimum number of pods that must be guaranteed during scale-in activities. | 0 |
recycle_node_deletion_enabled | boolean | No | Specifies whether to delete the corresponding Kubernetes node objects after nodes are removed in swift mode. | false |
scale_up_from_zero | boolean | No | Specifies whether the cluster autoscaler performs scale-out activities when the number of ready nodes in the cluster is zero. | 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 | see changesets | ||
|