All Products
Search
Document Center

Container Service for Kubernetes:CreateAutoscalingConfig

Last Updated:Feb 29, 2024

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

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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.
OperationAccess levelResource typeCondition keyAssociated operation
cs:CreateAutoscalingConfigWrite
  • Cluster
    acs:cs:{#regionId}:{#accountId}:cluster/{#ClusterId}
    none
none

Request syntax

POST /cluster/{ClusterId}/autoscale/config/

Request parameters

ParameterTypeRequiredDescriptionExample
ClusterIdstringYes

The cluster ID.

c0XXXXXXX10
bodyobjectNo

The request body.

cool_down_durationstringNo

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_durationstringNo

The cooldown period. Newly added nodes can be removed in scale-in activities only after the cooldown period ends. Unit: minutes.

10 m
utilization_thresholdstringNo

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_thresholdstringNo

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_intervalstringNo

The interval at which the cluster is scanned and evaluated for scaling. Unit: seconds.

30s
scale_down_enabledbooleanNo

Specifies whether to allow node scale-in activities. Valid values:

  • true: allows node scale-in activities.
  • false: does not allow node scale-in activities.
true
expanderstringNo

The node pool scale-out policy. Valid values:

  • least-waste: the default policy. If multiple node pools meet the requirement, this policy selects the node pool that will have the least idle resources after the scale-out activity is completed.
  • random: the random policy. If multiple node pools meet the requirement, this policy selects a random node pool for the scale-out activity.
  • priority: the priority-based policy If multiple node pools meet the requirement, this policy selects the node pool with the highest priority for the scale-out activity. The priority setting is stored in the ConfigMap named cluster-autoscaler-priority-expander in the kube-system namespace. When a scale-out activity is triggered, the policy obtains the node pool priorities from the ConfigMap based on the node pool IDs and then selects the node pool with the highest priority for the scale-out activity.
least-waste
skip_nodes_with_system_podsbooleanNo

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: does not allow the cluster autoscaler to scale in these nodes.
  • false: allows the cluster autoscaler to scale in these nodes.
true
skip_nodes_with_local_storagebooleanNo

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:

  • true: does not allow the cluster autoscaler to scale in these nodes.
  • false: allows the cluster autoscaler to scale in these nodes.
false
daemonset_eviction_for_nodesbooleanNo

Specifies whether to evict DaemonSet pods during scale-in activities. Valid values:

  • true: evicts DaemonSet pods.
  • false: does not evict DaemonSet pods.
false
max_graceful_termination_secintegerNo

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_countintegerNo

The minimum number of pods that must be guaranteed during scale-in activities.

0
recycle_node_deletion_enabledbooleanNo

Specifies whether to delete the corresponding Kubernetes node objects after nodes are removed in swift mode.

false
scale_up_from_zerobooleanNo

Specifies whether the cluster autoscaler performs scale-out activities when the number of ready nodes in the cluster is zero.

true

Response parameters

ParameterTypeDescriptionExample
The current API has no return parameters

Examples

Sample success responses

JSONformat

{}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-06-02The internal configuration of the API is changed, but the call is not affectedsee changesets
Change itemChange content
The internal configuration of the API is changed, but the call is not affected.