All Products
Search
Document Center

Container Service for Kubernetes:CreateAutoscalingConfig

Last Updated:Apr 04, 2026

Create an auto scaling policy to automatically add or remove compute resources based on configured scaling rules to handle your cluster's workload. You can specify metrics and thresholds, scaling order, a cooldown period, and more.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

cs:CreateAutoscalingConfig

create

*Cluster

acs:cs:{#regionId}:{#accountId}:cluster/{#ClusterId}

None None

Request syntax

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

Path Parameters

Parameter

Type

Required

Description

Example

ClusterId

string

Yes

The cluster ID.

cdde1f21ae22e483ebcb068a6eb7f****

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

The request body parameters.

cool_down_duration

string

No

The cool-down duration for scale-in events. This is the time interval from when the system detects a node is eligible for a scale-in to when the scale-in operation is executed.

Valid values: 1 to 60. Unit: minutes.

Default value: 10.

10

unneeded_duration

string

No

The stabilization window. This is the period after a scale-out event during which the scaler does not perform scale-in operations.

Valid values: 1 to 60. Unit: minutes.

Default value: 10.

10

utilization_threshold

string

No

The utilization threshold for a scale-in, which is the ratio of requested resources to the total allocatable resources on a node.

A node is eligible for a scale-in only when both its CPU and memory utilization fall below this threshold.

Valid values: [0.1, 1].

Default value: 0.5 (50%).

0.5

gpu_utilization_threshold

string

No

The GPU utilization threshold for a scale-in on GPU nodes, which is the ratio of requested resources to total allocatable resources on a node.

A GPU node is eligible for a scale-in only if its CPU, memory, and GPU utilization all fall below this threshold.

Valid values: [0.1, 1].

Default value: 0.3 (30%).

0.3

scan_interval

string

No

The frequency at which the system checks for scaling conditions.

Valid values: 15, 30, 60, 120, 180, and 300. Unit: seconds.

Default value: 60.

30

scale_down_enabled

boolean

No

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

  • true: Allows scale-in operations.

  • false: Disables scale-in operations.

Valid values:

  • true :

    true

  • false :

    false

true

expander

string

No

The strategy for selecting a node pool for a scale-out when multiple node pools are available. Valid values:

  • least-waste: The default strategy. The scaler selects the node pool that will have the least idle resources after a scale-out.

  • random: The scaler selects a random node pool from the list of eligible node pools.

  • priority: The scaler selects the node pool that has the highest priority. You must configure the priority of each scaling group by using the priorities parameter.

Valid values:

  • random :

    random

  • least-waste :

    least-waste

  • priority :

    priority

least-waste

skip_nodes_with_system_pods

boolean

No

Controls whether cluster-autoscaler can scale-in nodes that run Pods from the kube-system namespace. This setting does not affect DaemonSet or mirror Pods. Valid values:

  • true: Prevents these nodes from being scaled-in.

  • false: Allows these nodes to be scaled-in.

Valid values:

  • true :

    true

  • false :

    false

true

skip_nodes_with_local_storage

boolean

No

Controls whether cluster-autoscaler can scale-in nodes that run Pods using local storage (for example, with emptyDir or hostPath volumes). Valid values:

  • true: Prevents these nodes from being scaled-in.

  • false: Allows these nodes to be scaled-in.

Valid values:

  • true :

    true

  • false :

    false

false

daemonset_eviction_for_nodes

boolean

No

Specifies whether cluster-autoscaler evicts DaemonSet Pods from nodes during a scale-in event. Valid values:

  • true: Perform eviction.

  • false: Do not perform eviction.

Valid values:

  • true :

    true

  • false :

    false

false

max_graceful_termination_sec

integer

No

The maximum duration in seconds that cluster-autoscaler waits for Pods to terminate during a node drain for a scale-in event.

Unit: seconds.

Default value: 14400.

14400

min_replica_count

integer

No

The minimum number of Pods that must remain for any ReplicaSet after a scale-in operation. Nodes will not be scaled-in if doing so would violate this minimum.

Default value: 0.

0

recycle_node_deletion_enabled

boolean

No

Specifies whether to delete the Kubernetes Node object after a node is successfully scaled-in using fast scaling mode. For more information, see Scaling modes. Default value: false. Valid values:

  • true: The Node object is deleted after the instance is stopped. We do not recommend this setting because it can cause data inconsistencies in Kubernetes.

  • false: The Node object is retained after the instance is stopped.

Valid values:

  • true :

    true

  • false :

    false

false

scale_up_from_zero

boolean

No

Controls whether cluster-autoscaler performs a scale-out operation when there are no ready nodes in the cluster. Default value: true. Valid values:

  • true: A scale-out operation is performed.

  • false: No scale-out operation is performed.

Valid values:

  • true :

    true

  • false :

    false

true

scaler_type

string

No

The type of scaler to use. In clusters that run Kubernetes 1.24 or later, the default is goatscaler. In clusters that run an earlier version, the default is cluster-autoscaler. Valid values:

  • goatscaler: The proprietary scaler for fast scaling.

  • cluster-autoscaler: The standard Kubernetes cluster autoscaler.

Valid values:

  • goatscaler :

    goatscaler

  • cluster-autoscaler :

    cluster-autoscaler

goatscaler

priorities

object

No

Configures the priorities for scaling groups. This is used when the expander strategy is set to priority. After you create a node pool and enable autoscaling for it, you can configure the priority of its associated scaling group. For more information, see Enable node autoscaling.

The priority must be a positive integer from 1 to 100. A larger value indicates a higher priority.

array

No

The IDs of scaling groups that have the same priority.

string

No

The ID of a scaling group.

asg-bp1fe63lqz******

Response elements

Element

Type

Description

Example

object

cluster_id

string

The cluster ID.

cc212d04dfe184547bffaa596********

task_id

string

The task ID.

T-5fd211e924e1d007********

request_id

string

The request ID.

AF8BE105-C32B-1269-9774-5510********

Examples

Success response

JSON format

{
  "cluster_id": "cc212d04dfe184547bffaa596********",
  "task_id": "T-5fd211e924e1d007********",
  "request_id": "AF8BE105-C32B-1269-9774-5510********"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.