Adds existing Elastic Compute Service (ECS) instances to a Container Service for Kubernetes (ACK) cluster. When you need to add an ECS instance as a worker node to an ACK cluster or re-add a worker node to the cluster, you can call this operation.
Debugging
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:
- For mandatory resource types, indicate with a prefix of * .
- 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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
cs:AttachInstances | update | *Cluster acs:cs:{#regionId}:{#accountId}:cluster/{#ClusterId} |
| none |
Request syntax
POST /clusters/{ClusterId}/attach HTTP/1.1
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ClusterId | string | Yes | The cluster ID. | c106f377e16f34eb1808d6b9362c9**** |
body | object | No | The request body parameters. | |
instances | array | Yes | The ECS instances that you want to add. | |
string | No | The ECS instance ID. | i-2zed0sswuau6o89b**** | |
key_pair | string | No | The name of the key pair used to log on to the ECS instances. You must specify this parameter or Note
This parameter is not supported if you specify nodepool_id .
| secrity-key |
password | string | No | The SSH logon password used to log on to the ECS instances. You must specify this parameter or The password is encrypted during data transfer to ensure security. | Hello1234 |
format_disk | boolean | No | Specifies whether to store container data and images on data disks. Valid value:
Default value: How data disks are attached:
Note
If you choose to store container data and images on data disks and a data disk is already attached to the ECS instance, the original data on this data disk is cleared. You can back up the disk to prevent data loss.
| false |
keep_instance_name | boolean | No | Specifies whether to retain the instance name. Valid value:
Default value: | true |
is_edge_worker | boolean | No | Specifies whether the node that you want to add is an Edge Node Service (ENS) node. Valid value:
Default value: Note
If the node that you want to add is an ENS node, you must set the value to true . This allows you to identify the node.
| false |
nodepool_id | string | No | The ID of the node pool to which the node is added. 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. If you do not specify this parameter, the default system image is used. Note
| aliyun_2_1903_x64_20G_alibase_20200529.vhd |
cpu_policy | string | No | The CPU management policy of the node. The following policies are supported if the Kubernetes version of the cluster is 1.12.6 or later:
Default value: Note
This parameter is not supported if you specify nodepool_id .
| none |
user_data | string | No | The user-defined data on the node. For more information, see Use instance user data to automatically run commands or scripts on instance startup. Note
This parameter is not supported if you specify nodepool_id .
| IyEvdXNyL2Jpbi9iYXNoCmVjaG8gIkhlbGxvIEFDSyEi |
rds_instances | array | No | A list of ApsaraDB RDS instances. | |
string | No | The ApsaraDB RDS instance ID. Note
This parameter is not supported if you specify nodepool_id .
| rm-67yawhau**** | |
runtime | runtime | No | The container runtime. Note
This parameter is not supported if you specify nodepool_id .
| |
tags | array | No | The labels that you want to add to the node. When you add labels to a node, the following rules apply:
Note
This parameter is not supported if you specify nodepool_id .
| |
tag | No | The labels that you want to add to the node. |
Response parameters
Examples
Sample success responses
JSON
format
{
"list": [
{
"code": "200",
"instanceId": "i-2ze0lgm3y6iylcbt****",
"message": "successful"
}
],
"task_id": "T-5a544aff80282e39ea000039"
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|