All Products
Search
Document Center

Container Service for Kubernetes:DescribeClusterAttachScripts

Last Updated:Apr 04, 2026

Call the DescribeClusterAttachScripts operation to get the script to add an existing ECS instance to an ACK cluster as a worker node, or to re-add a node to a node pool.

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:DescribeClusterAttachScripts

update

*Cluster

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

None None

Request syntax

POST /clusters/{ClusterId}/attachscript HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

ClusterId

string

Yes

The cluster ID.

ca375a93a30474552ad2a0ebe183e****

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

The request body.

amd64

nodepool_id

string

No

The ID of the node pool to which you want to add the node.

Note

If you do not specify this parameter, the system adds the node to the default node pool.

np1c9229d9be2d432c93f77a88fca0****

format_disk

boolean

No

Specifies whether to mount a data disk to the instance and store containers and images on the disk when you manually add an existing instance to a cluster. Valid values:

  • true: Mounts a data disk to the instance. This action erases all data on the disk. We recommend that you back up your data first.

  • false: Does not mount a data disk to the instance.

Default value: false.

How a data disk is mounted:

  • If the last data disk attached to an ECS instance is uninitialized, the system automatically formats it to ext4. The system then uses this disk to store the contents of the /var/lib/docker and /var/lib/kubelet directories.

  • If the ECS instance does not already have a data disk, a new one is not attached.

false

keep_instance_name

boolean

No

Specifies whether to retain the name of the instance when you add the instance to the cluster. If you set this parameter to false, the system renames the instance to worker-k8s-for-cs-<clusterid>. Valid values:

  • true: Retains the instance name.

  • false: Does not retain the instance name. The system renames the instance based on its naming rules.

Default value: true.

true

rds_instances

array

No

Specify a list of ApsaraDB RDS instances to automatically add the IP addresses of the cluster's worker nodes to the allowlists of those RDS instances.

string

No

The name of the ApsaraDB RDS instance.

rm-xxx

arch

string

No

The CPU architecture of the node. Supported values include amd64, arm, and arm64.

Default value: amd64.

Note

This parameter is required for managed edge clusters.

amd64

options

string

No

The custom options for adding a node.

Note

This parameter is required for managed edge clusters.

{"enableIptables": true,"manageRuntime": true,"quiet": true,"allowedClusterAddons": ["kube-proxy","flannel","coredns"]}

expired

integer

No

The token's expiration time, specified as a Unix timestamp. For example, 1739980800 represents 2025-02-20 00:00:00.

1740037333

one_time_token

boolean

No

Response elements

Element

Type

Description

Example

string

The script for adding the node.

"wget http://***.oss-cn-hangzhou.aliyuncs.com/***"

Examples

Success response

JSON format

"\"wget http://***.oss-cn-hangzhou.aliyuncs.com/***\""

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.