All Products
Search
Document Center

Container Service for Kubernetes:Add existing ECS instances

Last Updated:Feb 27, 2026

Add existing Elastic Compute Service (ECS) instances to a Container Service for Kubernetes (ACK) cluster as worker nodes.

Request syntax

POST /clusters/<cluster_id>/attach

Replace <cluster_id> with the ID of the target ACK cluster.

CLI example

aliyun cs POST /clusters/<cluster_id>/attach \
  --header "Content-Type=application/json" \
  --body "$(cat attach.json)"

Headers

HeaderRequiredValue
Content-TypeYesapplication/json

Request body

Define the request body in a JSON file (for example, attach.json).

Parameters

ParameterTypeRequiredDescription
instancesArray of stringsYesECS instance IDs to add to the cluster.
passwordStringNoPassword of the ECS instance. Must be 8 to 30 characters in length and must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters. Cannot contain backslashes (\) or double quotation marks ("). You must specify this parameter or key_pair.
key_pairStringNoName of the key pair for login. You must specify this parameter or password.
format_diskBooleanNoSpecifies whether to store container data and images on data disks. Default value: false. If you set this parameter to true and a data disk is attached to the instance, the original data on the disk is cleared.
tagsArrayNoTags to apply to the nodes.
Specify password or key_pair for instance authentication.

Example

{
    "password": "ECSpassword1234",
    "instances": ["i-2zee3oiwcyoz7kwd****", "i-2ze0lgm3y6iylcbt****"],
    "format_disk": false,
    "key_pair": "",
    "tags": []
}

Response

A successful request returns a JSON object that contains a list array with the result for each instance and a task_id for tracking the operation.

Response parameters

ParameterTypeDescription
listArrayResults for each ECS instance.
list[].codeStringStatus code. "200" indicates success.
list[].instanceIdStringECS instance ID.
list[].messageStringResult description.
task_idStringID of the asynchronous task. Use this ID to track task progress.

Example

{
    "list": [
        {
            "code": "200",
            "instanceId": "i-2zee3oiwcyoz7kwd****",
            "message": "successful"
        },
        {
            "code": "200",
            "instanceId": "i-2ze0lgm3y6iylcbt****",
            "message": "successful"
        }
    ],
    "task_id": "T-5a544aff80282e39ea000039"
}