If you purchase an ECS instance and need to add the cloud server to an ACK cluster as a worker node, or if you remove a worker node and need to re-add the node instance to a node pool, you can invoke the AttachInstances operation to add existing ECS instances to the ACK cluster.
Operation description
Before calling this operation, carefully read Limits to ensure that the ECS instances to be added meet the requirements.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cs:AttachInstances |
update |
*Cluster
|
None | None |
Request syntax
POST /clusters/{ClusterId}/attach HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ClusterId |
string |
Yes |
The cluster ID. |
c106f377e16f34eb1808d6b9362c9**** |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The request body parameters. |
|
| instances |
array |
Yes |
The list of ECS instances to be added. |
|
|
string |
No |
The instance ID of the ECS instance to be added. |
i-2zed0sswuau6o89b**** |
|
| key_pair |
string |
No |
The name of the key pair for the instances to be added. You only need to specify one of the key_pair and password parameters, or leave both empty. Note
This parameter is not supported if nodepool_id is specified. |
security-key |
| password |
string |
No |
The SSH logon password for the instances to be added. You only need to specify one of the key_pair and password parameters, or leave both empty. The password must meet the following requirements:
For security purposes, the password is encrypted during transmission. |
Hello1234 |
| format_disk |
boolean |
No |
Specifies whether to store container data and images on data cloud disks. Valid values:
Default value: Rules for mounting data cloud disks:
Note
If you choose to store data on data cloud disks and the ECS instance already has data cloud disks attached, the existing data on the data cloud disks will be lost. Back up your data in advance. |
false |
| keep_instance_name |
boolean |
No |
Specifies whether to retain the original instance name. Valid values:
Default value: |
false |
| is_edge_worker |
boolean |
No |
Specifies whether the node to be added is an edge node, which is an Edge Node Service (ENS) node. Valid values:
Default value: Note
If the node is an edge node, you must set this parameter to |
false |
| nodepool_id |
string |
No |
The node pool ID. If you do not specify this parameter, the node is added to the default node pool. |
np615c0e0966124216a0412e10afe0**** |
| image_id |
string |
No |
The custom image ID.
Note
This parameter is not supported if nodepool_id is specified. |
aliyun_2_1903_x64_20G_alibase_20200529.vhd |
| cpu_policy |
string |
No |
The CPU management policy for the node. The following two policies are supported when the cluster version is 1.12.6 or later:
Default value: Note
This parameter is not supported if nodepool_id is specified. |
none |
| user_data |
string |
No |
The custom data for the node. For more information, see Generate instance user data. Note
This parameter is not supported if nodepool_id is specified. |
IyEvdXNyL2Jpbi9iYXNoCmVjaG8gIkhlbGxvIEFDSyEi |
| rds_instances |
array |
No |
The list of ApsaraDB RDS instances. |
|
|
string |
No |
The instance ID of the ApsaraDB RDS instance. Note
This parameter is not supported if nodepool_id is specified. |
rm-67yawhau**** |
|
| runtime | runtime |
No |
The container runtime. Note
This parameter is not supported if nodepool_id is specified. name: the name of the container runtime. ACK supports the following three container runtimes:
Default value: containerd. containerd: the version of the container runtime. The default value is the latest version. For more information about the changes to the sandboxed container runtime, see Release notes for sandboxed container runtime. |
|
| tags |
array |
No |
The node labels. Rules for defining labels:
For more information, see Labels and Selectors. Note
This parameter is not supported if nodepool_id is specified. |
|
| tag |
No |
The node label. |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response body parameters. |
||
| list |
array<object> |
The list of node addition information. |
|
|
object |
The details of the node addition result. |
||
| code |
string |
The status code of the node addition result. |
200 |
| instanceId |
string |
The ECS instance ID. |
i-2ze0lgm3y6iylcbt**** |
| message |
string |
The description of the node addition result. |
successful |
| task_id |
string |
The task ID. |
T-5a544aff80282e39ea00**** |
Examples
Success response
JSON format
{
"list": [
{
"code": "200",
"instanceId": "i-2ze0lgm3y6iylcbt****",
"message": "successful"
}
],
"task_id": "T-5a544aff80282e39ea00****"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.