Deleting a Node Pool

Function

This API is used to delete a specified node pool.

Note

The URL for cluster management is in the format of https://Endpoint/uri. In the URL, uri indicates the resource path, that is, the path for API access.

URI

DELETE /api/v3/projects/{project_id}/clusters/{cluster_id}/nodepools/{nodepool_id}

Table 1 describes the parameters of this API.

Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Project ID. For details about how to obtain the project ID, see How to Obtain Parameters in the API URI.

cluster_id

Yes

Cluster ID. For details about how to obtain the cluster ID, see How to Obtain Parameters in the API URI.

nodepool_id

Yes

Node pool ID. For details about how to obtain the node pool ID, see Listing All Node Pools in a Specified Cluster.

Request

Request parameters:

Table 1 describe the request parameters.

Table 2 Parameters in the request header

Parameter

Mandatory

String

Description

Content-Type

Yes

String

Message body type (format).

Default: application/json

X-Auth-Token

Yes

String

Requests for calling an API can be authenticated using either a token or AK/SK. If token-based authentication is used, this parameter is mandatory and must be set to a user token. For details on how to obtain a user token, see API Usage Guidelines.

Example request:

NA

Response

Response parameters:

Table 3 Response body parameters

Parameter

Type

Description

kind

String

API type. The value is fixed at NodePool.

Default: NodePool

apiVersion

String

API version. The value is fixed at v3.

Default: v3

metadata

NodePoolMetadata object

Metadata information of the node pool.

spec

NodePoolSpec object

Node pool specifications.

status

NodePoolStatus object

Node pool status.

Table 4 NodePoolMetadata

Parameter

Type

Description

name

String

Node pool name.

Note

Naming rules:

  • Enter 1 to 50 characters, starting with a lowercase letter and not ending with a hyphen (-). Only lowercase letters, digits, and hyphens (-) are allowed.

  • You cannot create node pools named DefaultPool.

Minimum: 1

Maximum: 50

uid

String

UID of the node pool. The value is automatically generated after the object is updated. A user-defined value will not take effect.

Table 5 NodePoolSpec

Parameter

Type

Description

type

String

Node pool type. If this parameter is left blank, the value vm is used by default.

  • vm: ECS

  • ElasticBMS: BMS. This value is valid in CCE Turbo cluster.

nodeTemplate

V3NodeSpec object

Detailed parameters of the node pool template.

initialNodeCount

Integer

Initial number of nodes for the node pool.

autoscaling

NodePoolNodeAutoscaling object

Auto scaling parameters.

nodeManagement

NodeManagement object

Node management configuration.

customSecurityGroups

Array of strings

Custom security group settings for a node pool. New nodes scaled out in a node pool can be bound to a specified security group.

  • Specifying no security group ID will add the new nodes to the default security group of the worker nodes.

  • Specifying a valid security group ID will put new nodes in that security group.

  • When specifying a security group, do not modify the rules of the port on which CCE running depends.

Table 6 V3NodeSpec

Parameter

Type

Description

flavor

String

Node specifications.

Minimum: 1

Maximum: 50

az

String

\t\nName of the AZ where the node is located. This AZ exists at the underlying layer and is in the physical AZ group of the user.

Maximum: 200

os

String

Node OS.

  • Nodes in clusters of Kubernetes v1.11 or earlier support EulerOS 2.2.

  • Nodes in clusters of Kubernetes v1.13, v1.15, v1.17, v1.19, v1.21, v1.23, or v1.25 support EulerOS 2.5.

  • Nodes in clusters of Kubernetes v1.19 or later support EulerOS 2.9.

  • Nodes in clusters of Kubernetes v1.25 or later support Ubuntu 22.04 and HCE OS 2.0.

login

Login object

Node login mode.

rootVolume

Volume object

System disk information of the node.

dataVolumes

Array of Volume objects

Data disk parameters of the node. Currently, you can add the second data disk for your node on the CCE console.

storage

Storage object

Disk initialization management parameter.

This parameter is complex to configure. For details, see Attaching Disks to a Node.

If this parameter retains its default, disks are managed based on the DockerLVMConfigOverride (discarded) parameter in extendParam. This parameter is supported by clusters of version 1.15.11 and later.

Note

If a node specification involves local disks and EVS disks at the same time, do not retain the default value of this parameter to prevent unexpected disk partitions.

publicIP

V3NodePublicIP object

EIP of the node.

nodeNicSpec

NodeNicSpec object

NIC information of the node.

count

Integer

Number of nodes to be created in a batch. The value must be a positive integer greater than or equal to 1 and less than or equal to the defined limit. This field can be set to 0 for a node pool.

billingMode

Integer

Billing mode of a node.

Note

This field is not supported for the current version.

taints

Array of Taint objects

You can add taints to created nodes to set affinity. Each taint contains the following three parameters:

  • Key: The value must start with a letter or digit and can contain letters, digits, hyphens (-), underscores (*), and periods (.). The maximum length is 63 characters. In addition, the DNS subdomain can be used as the prefix.*

  • Value: The value must start with a letter or digit and can contain a maximum of 63 characters, including letters, digits, hyphens (-), underscores (), and periods (.).

  • Effect: Available options are NoSchedule, PreferNoSchedule, and NoExecute.

Example:

"taints": [{
        "key": "status",
        "value": "unavailable",
        "effect": "NoSchedule"
 }, {
        "key": "looks",
        "value": "bad",
        "effect": "NoSchedule"
 }]

k8sTags

Map<String,String>

The format is a key-value pair. The number of key-value pairs cannot exceed 20.

  • Key: Enter 1 to 63 characters, starting with a letter or digit. Only letters, digits, hyphens (-), underscores (*), and periods (.) are allowed. A DNS subdomain can be prefixed to a key and contain a maximum of 253 characters. Example DNS subdomain: example.com/my-key*

  • Value: The value can be left blank or contain 1 to 63 characters that start with a letter or digit. Only letters, digits, hyphens (-), underscores (), and periods (.) are allowed in the character string.

Example:

"k8sTags": {
        "key": "value"
 }

ecsGroupId

String

Cloud server group ID. If this field is specified, the node is created in the specified cloud server group.

Note

This field is not supported when you use CCE Turbo cluster.

dedicatedHostId

String

ID of the DeH to which the node is scheduled.

This field is not supported when you add a node during node pool creation.

offloadNode

Boolean

Whether the node belongs to a CCE Turbo cluster.

Note

This field is not supported when you add a node during node pool creation.

userTags

Array of UserTag objects

Cloud server labels. The key of a label must be unique. The maximum number of user-defined labels supported by CCE depends on the region. In the region that supports the least number of labels, you can still create up to 5 labels for a cloud server.

extendParam

Map<String,Object>

Extended parameter for creating a node. The options are as follows:

  • ecs:performancetype: ECS flavor. This field does not exist for a BMS node.

  • productID: product ID.

  • maxPods: maximum number of pods that can be created on a node, including the default system pods. Value range: 16 to 256 This limit prevents the node from being overloaded fpr managing too many pods.

  • DockerLVMConfigOverride: Docker data disk configuration item. (This parameter has been discarded. Use the storage field instead.) The following is an example default configuration:

    "DockerLVMConfigOverride":"dockerThinpool=vgpaas/90%VG;kubernetesLV=vgpaas/10%VG;diskType=evs;lvType=linear"
    

    The configuration contains the following fields:

    • userLV: size of the user space, for example, vgpaas/20%VG.

    • userPath: mount path of the user space, for example, /home/wqt-test.

    • diskType: disk type. Currently, only evs, hdd, and ssd are supported.

    • lvType: type of a logic volume. Currently, the value can be linear or striped.

    • dockerThinpool: Docker space size, for example, vgpaas/60%VG.

    • kubernetesLV: kubelet space size, for example, vgpaas/20%VG.

  • dockerBaseSize: available disk space of a single Docker container on a node in Device Mapper mode. This field is not supported in OverlayFS mode (nodes that use Ubuntu 18.04 in CCE Turbo clusters and nodes that use Ubuntu 18.04 in CCE clusters).

  • init-node-password: initial node password

  • offloadNode: whether the node is a CCE Turbo cluster node.

  • publicKey: node public key. Used when creating a key pair.

  • alpha.cce/preInstall: pre-installation script.

Note

The input value must be Base64-encoded. (Command: echo -n Content to be encoded | base64)

  • alpha.cce/postInstall: post-installation script

Note

The input value must be Base64-encoded. (Command: echo -n Content to be encoded | base64)

  • alpha.cce/NodeImageID: This field is required when a custom image is used to create a BMS node.

runtime

Runtime object

Container runtime. The default value is docker.

Table 7 Login

Parameter

Type

Description

sshKey

String

Name of the key pair used for login. Either the key pair or password must be used for login.

For details on how to create a key pair, see Creating a Key Pair.

userPassword

String

Password used for node login.

Note

This field is not supported for the current version.

Table 8 Volume

Parameter

Type

Description

size

Integer

Disk size in the unit of GB.

  • System disk: 40 to 1024

  • Data disk: 100 to 32768

volumetype

String

Disk type. For details about possible values, see the description of the root_volume parameter in the API used to create an ECS in the ECS API reference.

  • SATA: common I/O

  • SAS: high I/O

  • SSD: ultra-high I/O

  • GPSSD: general-purpose SSD

  • ESSD: extreme SSD

extendParam

Map<String,Object>

Disk extension parameter. For details, see the description of the extendparam parameter in Creating an ECS.

hw:passthrough

Boolean

  • Pay attention to this field if your ECS is SDI-compliant. If the value of this field is true, the created disk is of the SCSI type.

  • If the node pool type is ElasticBMS, this field must be set to true.

metadata

dataVolumeMetadata object

Data disk encryption information. This parameter is mandatory only when the data disk of the node to be created needs to be encrypted.

If data disks are created using a data disk image, this parameter cannot be used.

Table 9 DataVolumeMetadata

Parameter

Type

Description

__system__encrypted

String

Whether the EVS disk is encrypted. The value 0 indicates that the EVS disk is not encrypted, and the value 1 indicates that the EVS disk is encrypted.

If this field does not exist, the disk will not be encrypted by default.

__system__cmkid

String

CMK ID, which indicates encryption in metadata. This field is used with __system__encrypted.

Table 10 V3NodePublicIP

Parameter

Type

Description

ids

Array of strings

IDs of existing EIPs. The quantity cannot be greater than the number of nodes to be created.

Note

If the ids parameter has been set, you do not need to set the count and eip parameters.

count

Integer

Number of EIPs to be dynamically created.

Note

The count and eip parameters must be set together.

eip

V3NodeEIPSpec object

EIP configuration.

Table 11 V3NodeEIPSpec

Parameter

Type

Description

iptype

String

EIP type.

bandwidth

V3NodeBandwidth object

Bandwidth parameters of the EIP.

Table 12 V3NodeBandwidth

Parameter

Type

Description

chargemode

String

Bandwidth billing modes:

  • If this field is not specified, the billing is based on bandwidth.

  • If the field is null, the billing is based on bandwidth.

  • If the field value is traffic, the billing is based on traffic.

  • If the value is out of the preceding options, the cloud server will fail to be created.

Note

  • Billed by bandwidth: The billing will be based on the data transfer rate (in Mbps) of public networks. If your bandwidth usage is higher than 10%, this billing mode is recommended.

  • Billed by traffic: The billing will be based on the total traffic (in GB) transferred on public networks. If your bandwidth usage is lower than 10%, this billing mode is recommended.

size

String

Bandwidth size.

sharetype

String

Bandwidth sharing type.

Table 13 NodeNicSpec

Parameter

Type

Description

primaryNic

primaryNic object

Description of the primary NIC.

extNics

Array of extNics objects

Extension NIC.

Table 14 Data structure of the primaryNic/extNics field

Parameter

Type

Description

subnetId

String

Network ID of the subnet to which the NIC belongs.

fixedIps

Array of strings

The IP address of the primary NIC is specified by fixedIps. The number of IP addresses cannot be greater than the number of created nodes. fixedIps and ipBlock cannot be specified at the same time.

ipBlock

String

CIDR format of the IP address segment. The IP address of the created node falls in this IP address segment. fixedIps and ipBlock cannot be specified at the same time.

Table 15 Taint

Parameter

Type

Description

key

String

Key.

value

String

Value.

Maximum: 63

effect

String

Effect.

Enumeration values:

  • NoSchedule

  • PreferNoSchedule

  • NoExecute

Table 16 UserTag

Parameter

Type

Description

key

String

Key of the cloud server label. The value cannot start with CCE- or __type_baremetal.

Minimum: 1

Maximum: 36

value

String

Value of the cloud server label.

Minimum: 0

Maximum: 43

Table 17 NodePoolNodeAutoscaling

Parameter

Type

Description

enable

Boolean

Whether to enable auto scaling.

Default: false

minNodeCount

Integer

Minimum number of nodes allowed if auto scaling is enabled. The value cannot be greater than the maximum number of nodes allowed by the cluster specifications.

Minimum: 0

maxNodeCount

Integer

Maximum number of nodes allowed if auto scaling is enabled. This value must be greater than or equal to the value of minNodeCount and cannot exceed the maximum number of nodes in the cluster specifications.

Minimum: 0

scaleDownCooldownTime

Integer

Interval between two scaling operations, in minutes. During this period, nodes added after a scale-up will not be deleted.

Minimum: 0

Maximum: 2147483647

priority

Integer

Weight of a node pool. A node pool with a higher weight has a higher priority during scaling.

Table 18 NodeManagement

Parameter

Type

Description

serverGroupReference

String

Cloud server group ID. If this field is specified, all nodes in the node pool will be created in this group. The group ID can be specified only when you create the node pool and cannot be modified. When you specify a cloud server group, the number of nodes in the node pool cannot exceed the group quota.

Table 19 NodePoolStatus

Parameter

Type

Description

currentNode

Integer

Number of nodes in the node pool.

phase

String

Node pool status. If this field is left blank, the node pool is available.

  • Synchronizing: Scale-in is being performed.

  • Synchronized: The node pool fails to be updated.

  • SoldOut: Node resources are sold out.

  • Deleting: The node pool is being deleted.

  • Error: An error occurs.

Enumeration values:

  • Synchronizing

  • Synchronized

  • SoldOut

  • Deleting

  • Error

jobId

String

ID of the job to delete the node pool.

Table 20 Runtime

Parameter

Mandatory

Type

Description

name

No

String

Container runtime. The default value is docker.

Enumeration values:

  • docker

  • containerd

Table 21 Storage

Parameter

Type

Description

storageSelectors

Array of StorageSelectors objects

Disk selection. Matched disks are managed according to matchLabels and storageType.

storageGroups

Array of StorageGroups objects

A storage group consists of multiple storage devices. It is used to divide storage space.

Table 22 StorageSelectors

Parameter

Type

Description

name

String

Selector name, used as the index of selectorNames in storageGroup. Therefore, the name of each selector must be unique.

storageType

String

Specifies the storage type. Currently, only evs (EVS volumes) and local (local volumes) are supported. The local storage does not support disk selection. All local disks will form a VG. Therefore, only one storageSelector of the local type is allowed.

matchLabels

matchLabels object

Matching field of an EVS volume. The size, volumeType, metadataEncrypted, metadataCmkid and count fields are supported.

Table 23 matchLabels

Parameter

Type

Description

size

String

Matched disk size. If this parameter is left unspecified, the disk size is not limited. Example: 100

volumeType

String

EVS disk type.

  • SATA: common I/O

  • SAS: high I/O

  • SSD: ultra-high I/O

  • GPSSD: general-purpose SSD

  • ESSD: extreme SSD

metadataEncrypted

String

Disk encryption identifier. 0 indicates that the disk is not encrypted, and 1 indicates that the disk is encrypted.

metadataCmkid

String

Customer master key ID of an encrypted disk. The value is a 36-byte string.

count

String

Number of disks to be selected. If this parameter is left blank, all disks of this type are selected.

Table 24 StorageGroups

Parameter

Type

Description

name

String

Name of a virtual storage group, which must be unique.

cceManaged

Boolean

Storage space for Kubernetes and runtime components. Only one group can be set to true. If this parameter is left blank, the default value false is used.

selectorNames

Array of strings

This parameter corresponds to name in storageSelectors. A group can match multiple selectors, but a selector can match only one group.

virtualSpaces

Array of VirtualSpace objects

Detailed management of space configuration in a group.

Table 25 VirtualSpace

Parameter

Type

Description

name

String

Name of a virtualSpace.

  • Kubernetes: Kubernetes space configuration. lvmConfig needs to be configured.

  • runtime: runtime space configuration. runtimeConfig needs to be configured.

  • user: user space configuration. lvmConfig needs to be configured.

size

String

Size of a virtualSpace. The value must be an integer in percentage. Example: 90%.

Note

The sum of the percentages of all virtualSpaces in a group cannot exceed 100%.

lvmConfig

LVMConfig object

LVM configurations, applicable to kubernetes and user spaces. Note that one virtual space supports only one config.

runtimeConfig

RuntimeConfig object

runtime configurations, applicable to the runtime space. Note that one virtual space supports only one config.

Table 26 LVMConfig

Parameter

Type

Description

lvType

String

LVM write mode. linear indicates the linear mode. striped indicates the striped mode, in which multiple disks are used to form a strip to improve disk performance.

path

String

Path to which the disk is attached. This parameter takes effect only in user configuration. The value is an absolute path. Digits, letters, periods (.), hyphens (-), and underscores (_) are allowed.

Table 27 RuntimeConfig

Parameter

Type

Description

lvType

String

LVM write mode. linear indicates the linear mode. striped indicates the striped mode, in which multiple disks are used to form a strip to improve disk performance.

Example response:

{
    "kind": "NodePool",
    "apiVersion": "v3",
    "metadata": {
        "name": "test-nodepool",
        "uid": "65787e3e-cd82-11ea-8ec6-0255ac1001be"
    },
    "spec": {
        "initialNodeCount": 0,
        "type": "vm",
        "nodeTemplate": {
            "flavor": "s6.large.2",
            "az": "eu-de-01",
            "os": "EulerOS 2.5",
            "login": {
                "sshKey": "KeyPair-nodepool",
                "userPassword": {}
            },
            "rootVolume": {
                "volumetype": "SATA",
                "size": 40
            },
            "dataVolumes": [
                {
                    "volumetype": "SATA",
                    "size": 100,
                    "extendParam": {
                        "useType": "docker"
                    },
                    "metadata": {
                        "__system__cmkid": "1ed68cb7-b09b-423c-8d66-fdd2e063769d",
                        "__system__encrypted": "1"
                    }
                }
            ],
            "storage": {
                "storageSelectors": [
                    {
                        "name": "cceUse",
                        "storageType": "evs",
                        "matchLabels": {
                            "size": "100",
                            "volumeType": "SAS",
                            "count": "1"
                        }
                    }
                ],
                "storageGroups": [
                    {
                        "name": "vgpaas",
                        "selectorNames": [
                            "cceUse"
                        ],
                        "cceManaged": true,
                        "virtualSpaces": [
                            {
                                "name": "runtime",
                                "size": "90%"
                            },
                            {
                                "name": "kubernetes",
                                "size": "10%"
                            }
                        ]
                    }
                ]
            },
            "runtime": {
                "name":"docker"
            },
            "publicIP": {
                "eip": {
                    "bandwidth": {}
                }
            },
            "nodeNicSpec": {
                "primaryNic": {
                    "subnetId": "3d6f5dc2-caf7-4a06-b4ac-11a3a5a49cdd"
                }
            },
            "billingMode": 0,
            "taints": [
                {
                    "key": "test-taints",
                    "value": "test",
                    "effect": "NoSchedule"
                }
            ],
            "k8sTags": {
                "cce.cloud.com/cce-nodepool": "test-nodepool",
                "test-k8stag": "test"
            },
            "userTags": [
                {
                    "key": "test-resourcetag",
                    "value": "test"
                }
            ],
            "extendParam": {
                "DockerLVMConfigOverride": "dockerThinpool=vgpaas/90%VG;kubernetesLV=vgpaas/10%VG;diskType=evs;lvType=linear",
                "alpha.cce/postInstall": "bHMgLWwK",
                "alpha.cce/preInstall": "bHMgLWw=",
                "maxPods": 100
            }
        },
        "autoscaling": {
            "enable": true,
            "minNodeCount": 0,
            "maxNodeCount": 4,
            "scaleDownCooldownTime": 5,
            "priority": 1
        },
        "nodeManagement": {
            "serverGroupReference": "2129f95a-f233-4cd8-a1b2-9c0acdf918d3"
        }
    },
    "status": {
        "currentNode": 0,
        "phase": "Deleting",
        "jobId": "d11c13c4-cd82-11ea-8ec6-0255ac1001be"
    }
}

Status Code

Table 28 describes the status code of this API.

Table 28 Status code

Status Code

Description

200

The job for deleting a node pool is successfully delivered.

For details about error status codes, see Status Code.