All Products
Search
Document Center

Container Service for Kubernetes:AttachInstancesToNodePool

Last Updated:Aug 27, 2026

Adds existing nodes to a specific node pool. You can add existing ECS instances to a specific node pool in a Container Service for Kubernetes (ACK) cluster as worker nodes. You can also add removed worker nodes back to the 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:AttachInstancesToNodePool

update

*Cluster

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

None None

Request syntax

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

Path Parameters

Parameter

Type

Required

Description

Example

ClusterId

string

Yes

The cluster ID.

c82e6987e2961451182edacd74faf****

NodepoolId

string

Yes

The node pool ID.

np31da1b38983f4511b490fc62108a****

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

The request body.

instances

array

No

The IDs of the instances to be added.

string

No

The ID of the instance to be added.

i-2zed0sswuau6o89b****

password

string

No

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

******

format_disk

boolean

No

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_name

boolean

No

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 elements

Element

Type

Description

Example

object

The returned data.

request_id

string

The request ID.

D7631D83-6E98-1949-B665-766A62xxxxxx

task_id

string

The task ID.

T-5a54309c80282e39eaxxxxxx

Examples

Success response

JSON format

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

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.