All Products
Search
Document Center

Container Service for Kubernetes:AttachInstancesToNodePool

Last Updated:Feb 29, 2024

You can call the AttachInstancesToNodePool operation to add existing nodes to a node pool.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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:
    • The required resource types are displayed in bold characters.
    • 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.
OperationAccess levelResource typeCondition keyAssociated operation
cs:AttachInstancesToNodePoolWrite
  • Cluster
    acs:cs:{#regionId}:{#accountId}:cluster/{#ClusterId}
    none
none

Request syntax

POST /clusters/{ClusterId}/nodepools/{NodepoolId}/attach

Request parameters

ParameterTypeRequiredDescriptionExample
ClusterIdstringYes

The cluster ID.

c82e6987e2961451182edacd74faf****
NodepoolIdstringYes

The node pool ID.

np31da1b38983f4511b490fc62108a****
bodyobjectNo

The request body.

instancesarrayNo

The IDs of the instances to be added.

stringNo

The ID of the instance to be added.

i-2zed0sswuau6o89b****
passwordstringNo

The SSH password that is used to log on to the instance.

Hello1234
format_diskbooleanNo

Specifies whether to store container data and images on data disks. Valid values:

  • true: stores container data and images on data disks.
  • false: does not store container data or images on data disks.

Default value: false.

How to mount a data disk:

  • If the ECS instances are already mounted with data disks and the file system of the last data disk is not initialized, the system automatically formats this data disk to ext4 and mounts it to /var/lib/docker and /var/lib/kubelet.
  • If no data disk is attached to the ECS instances, the system does not purchase a new data disk.
Note If you choose to store container data and images on a data disk and the data disk is already mounted to the ECS instance, the existing data on the data disk will be cleared. You can back up the disk to avoid data loss.
false
keep_instance_namebooleanNo

Specifies whether to retain the instance name. Valid values:

  • true: retains the instance name.
  • false: does not retain the instance name.

Default value: true.

true

Response parameters

ParameterTypeDescriptionExample
object

The returned data.

request_idstring

The request ID.

D7631D83-6E98-1949-B665-766A62xxxxxx
task_idstring

The task ID.

T-5a54309c80282e39ea00002f

Examples

Sample success responses

JSONformat

{
  "request_id": "D7631D83-6E98-1949-B665-766A62xxxxxx",
  "task_id": "T-5a54309c80282e39ea00002f"
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-07-21The internal configuration of the API is changed, but the call is not affectedsee changesets
Change itemChange content
The internal configuration of the API is changed, but the call is not affected.