- Documentation
Volcengine Kubernetes Engine
Volcengine Kubernetes Engine
Development guide
Terraform
Managing existing nodes in a custom node pool by using Terraform
Terraform
Managing existing nodes in a custom node pool by using Terraform
Managing existing nodes in a custom node pool by using Terraform
This topic describes how to add nodes to or remove nodes from a custom node pool by using Terraform.
Prerequisites
Limit
When you add an existing ECS instance to a custom node pool:
- The custom node pool must meet the following requirements:
- The autoscaler is not enabled for the node pool.
- The current node pool status is running.
- The current node pool billing mode is Pay-as-you-go or Subscription.
- For ECS instances, the following conditions need to be met:
- Running in the same VPC as the current cluster.
- Be under the same project as the target node pool.
- The instance is not in a scaling group of any cluster or autoscaler service.
- The instance only has one network interface card.
- The system volume of the instance has a capacity ≥ (image size configured for the target node pool + 10 GiB).
- The data volumes of the instance must include the data volumes specified for mounting in the target node pool, and the volume type and size must be exactly the same.
Adding existing nodes to a custom node pool
Follow the steps below to add an ECS instance to a custom node pool by using Terraform.
- Create a folder and a configuration file named main.tf in the folder.
- Initialize the Terraform environment.
- The expected result is as follows.
- Perform resource planning.
- The expected result is as follows.
- Add the existing instance to the custom node pool.
- The expected result is as follows.
- You can also view nodes in the custom node pool (with the ID pcq3p3f****** in this example) in the VKE console.
Removing a node from a custom node pool
To remove a previously added node from a custom node pool using Terraform, follow these steps.
Warning
- Regardless of whether the billing method for the existing node to be removed is subscription or pay-as-you-go, this action will not release the node. You can release the node in the ECS console. For detailed steps, see Deleting instances.
- This action is only intended to remove existing nodes (ECS instances) that were previously added to the custom node pool. To remove nodes created in the custom node pool, update the replica quantity of the custom node pool. For details, see Node pool scaling.
- In the main.tf file, go to the volcengine_vke_node_pool section and remove the ID of the target ECS instance from the instance_ids field value.
- Run the command to remove the node.
- The expected result is as follows.
- You can check whether the node has been removed from the target custom node pool in the VKE console.
Last updated: 2026.03.31 10:58:15