Updated on 2024-03-12 GMT+08:00

Creating a Node Pool

Function

This API is used to create a node pool in a specified cluster. This API can be called only when the cluster is in the available, scaling-out, or scaling-in state.

When creating a node pool in a cluster of v1.21, you can bind security groups to the node pool. A maximum of five security groups can be bound to a node pool.

After the security groups of a node pool are updated, the update takes effect only for newly created pods. You are advised to evict the original pods on the node.

If there is no cluster, create one. 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.

Calling Method

For details, see Calling APIs.

URI

POST /api/v3/projects/{project_id}/clusters/{cluster_id}/nodepools

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

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

cluster_id

Yes

String

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

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Message body type (format).

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, see Obtaining a User Token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

kind

Yes

String

API type. The value is fixed at NodePool.

apiVersion

Yes

String

API version. The value is fixed at v3.

metadata

Yes

NodePoolMetadata object

Metadata information of the node pool

spec

Yes

NodePoolSpec object

Node pool specifications

status

No

NodePoolStatus object

Node pool status

Table 4 NodePoolMetadata

Parameter

Mandatory

Type

Description

name

Yes

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.

uid

No

String

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

annotations

No

Map<String,String>

Annotations of a node pool in key-value pairs. This parameter is used only for query and cannot be input through a request. Entered data of this parameter is invalid.

updateTimestamp

No

String

Update time.

creationTimestamp

No

String

Creation time.

Table 5 NodePoolSpec

Parameter

Mandatory

Type

Description

type

No

String

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

  • vm: ECS

  • ElasticBMS: C6 general computing-plus BMS. An example flavor is c6.22xlarge.2.physical.

  • bms: BMS

nodeTemplate

Yes

NodeSpec object

Detailed parameters of the node pool template.

initialNodeCount

No

Integer

Initial number of nodes for the node pool. When queried, the value is the number of target nodes in the node pool.

autoscaling

No

NodePoolNodeAutoscaling object

Auto scaling parameters

nodeManagement

No

NodeManagement object

Node management configuration

podSecurityGroups

No

Array of SecurityID objects

Security group configuration. This parameter is available only for CCE Turbo clusters.

customSecurityGroups

No

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.

Table 6 NodeSpec

Parameter

Mandatory

Type

Description

flavor

Yes

String

Node specifications. For details about the node specifications supported by CCE, see Node Flavor Description.

az

Yes

String

Name of the AZ where the node to be created is located. . For details about AZs supported by CCE, see Regions and Endpoints.

os

No

String

The OS type of the node. For details about the supported OSs, see [Node OS Description] (node-os.xml).

NOTE:
  • The system automatically selects the supported OS based on the cluster version. If the current cluster does not support the OS, an error will be reported.

  • If alpha.cce/NodeImageID in extendParam is specified during node creation, you do not need to configure this parameter.

  • This parameter is mandatory when creating a node pool.

login

Yes

Login object

Node login mode. Either the key pair or password must be used for login.

rootVolume

Yes

Volume object

Information about disks on the node

dataVolumes

Yes

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. This data disk is used by the container runtime and kubelet. Do not uninstall this disk. Otherwise, the node will become unavailable. For DeC nodes, the parameter description is the same as that for rootVolume.

storage

No

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

No

NodePublicIP object

EIP of a node.

NOTE:

This parameter is not supported when you add a node to a node pool.

nodeNicSpec

No

NodeNicSpec object

NIC of the node

count

No

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 parameter can be left blank when it is used for a node pool.

billingMode

No

Integer

Node billing mode.

  • 0: pay-per-use

  • 1: yearly/monthly

  • 2: (discarded) yearly/monthly billing with auto payment enabled

taints

No

Array of Taint objects

You can add taints to created nodes to configure anti-affinity. A maximum of 20 taints can be added. Each taint contains the following parameters:

  • Key: A key must contain 1 to 63 characters starting with a letter or digit. Only letters, digits, hyphens (-), underscores (_), and periods (.) are allowed. A DNS subdomain name can be used as the prefix of a key.

  • Value: A 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. When creating a node, you can specify the initial value for this parameter and this field is not returned during query. In using node pools, the initial value can be specified in the node template and this field is returned during query. In other scenarios, this field is not returned during query.

Example:

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

k8sTags

No

Map<String,String>

Defined in key-value pairs. A maximum of 20 key-value pairs are allowed.

  • 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. When creating a node, you can specify the initial value for this parameter and this field is not returned during query. In using node pools, the initial value can be specified in the node template and this field is returned during query. In other scenarios, this field is not returned during query.

Example:

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

ecsGroupId

No

String

ECS group ID. If this parameter is configured, nodes will be created in the specified ECS group.

NOTE:

This configuration does not take effect when a node pool is created. To ensure that all nodes in a node pool are in the same ECS group, configure nodeManagement in the node pool.

dedicatedHostId

No

String

ID of the DeH to which the node is scheduled.

NOTE:

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

userTags

No

Array of UserTag objects

Cloud server tag. The key of a tag must be unique. The maximum number of custom tags supported by CCE depends on the region and cannot exceed 8. When creating a node, you can specify the initial value for this parameter and this field is not returned during query. In using node pools, the initial value can be specified in the node template and this field is returned during query. In other scenarios, this field is not returned during query.

NOTE:

Use only letters, Unicode characters, digits, special characters(-,_). Max characters: 36

runtime

No

Runtime object

Container runtime:

  • Clusters of v1.25 or earlier: docker.

  • Clusters of v1.25 or later: Container runtime varies with the OS. For nodes running EulerOS 2.5 or EulerOS 2.8, the default container runtime is docker. For nodes running other OSs, the default container runtime is containerd.

initializedConditions

No

Array of strings

Custom initialization flag, which is left blank by default.

Before CCE nodes are initialized, node.cloudprovider.kubernetes.io/uninitialized is added to the nodes to prevent pods from being scheduled to these nodes. When creating a node, you can configure the initializedConditions parameter to control the taint removal time. By default, the timeout period is not configured.

Example:

  1. Create a node and add parameter "initializedConditions": ["CCEInitial", "CustomedInitial"].

  2. After custom initialization is complete, CCE will call a Kubernetes API (for example, PATCH /v1/nodes/{node_ip}/status) to update the node conditions by adding two labels of types CCEInitial and CustomedInitial and setting the status to True, as shown in the following:

status:
  conditions:
  - type: CCEInitial
    status: 'True'
  - type: CustomedInitial
    status: 'True'
  1. CCE polls status.Conditions of nodes to check whether there are conditions of types CCEInitial and CustomedInitial. If such conditions exist and the status is True, the node initialization is complete and the initialization taint is removed.

  2. initializedConditions allows you to configure a timeout period during node creation. For example, "initializedConditions": ["CCEInitial:15m", "CustomedInitial:15m"] indicates that the timeout period is 15 minutes. After the timeout period is reached, the initialization conditions will be automatically ignored and the initialization taint will be removed when CCE polls the node.

  • Use only letters and digits. Max. characters: 20.

  • Max. flags: 2.

  • The unit of the timeout period is minute (m).

extendParam

No

NodeExtendParam object

Extended parameters for creating a node.

hostnameConfig

No

HostnameConfig object

Kubernetes node name configuration parameter, which is supported by clusters of v1.23.6-r0 to v1.25 or clusters of v1.25.2-r0 or later versions.

Table 7 Login

Parameter

Mandatory

Type

Description

sshKey

No

String

Name of the key pair used for login.

userPassword

No

UserPassword object

Password used for node login.

Table 8 UserPassword

Parameter

Mandatory

Type

Description

username

No

String

Login account. Defaults to root.

password

Yes

String

If a username and a password are used to create a node, this field is shielded in the response body. A password must meet the following complexity requirements:

  • Contains 8 to 26 characters.

  • Contains at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters (!@$%^-_=+[{}]:,./?~#*)

  • Cannot contain the username or the username spelled backwards. The password field must be salted during node creation. For details, see Adding a Salt in the password Field When Creating a Node.

Table 9 Volume

Parameter

Mandatory

Type

Description

size

Yes

Integer

Disk size, in GB.

  • System disk: 40 to 1024 -Value range for data disks: 100 to 32768

volumetype

Yes

String

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

  • SAS: high I/O SAS disk

  • SSD: ultra-high I/O SSD disk

  • SATA: common I/O SATA disk SATA disks have been removed from EVS. You can find them attached only on existing nodes.

extendParam

No

Map<String,Object>

Extended disk parameters, defined in extendparam in the API used to create an ECS.

For details, see Creating an ECS.

cluster_id

No

String

ID of the storage pool used by the ECS system disk. This field is used only for DeC clusters, which functions as dssPoolID, that is, the ID of the DSS storage pool.

To obtain the value, see the ID field in the API used to obtain details of a DSS storage pool.

cluster_type

No

String

Storage class of the cloud server system disk. The value is always dss. This field is used only for DeC clusters.

hw:passthrough

No

Boolean

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

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

  • If a node specification involves local disks and EVS disks at the same time, set the disk initialization parameters. For details, see Attaching Disks to a Node.

metadata

No

VolumeMetadata object

EVS disk encryption information. This field is mandatory only when you need to encrypt the system disk or data disks of the node to be created.

Table 10 VolumeMetadata

Parameter

Mandatory

Type

Description

__system__encrypted

No

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 parameter is not specified, EVS disks will not be encrypted by default.

__system__cmkid

No

String

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

Table 11 Storage

Parameter

Mandatory

Type

Description

storageSelectors

Yes

Array of StorageSelectors objects

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

storageGroups

Yes

Array of StorageGroups objects

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

Table 12 StorageSelectors

Parameter

Mandatory

Type

Description

name

Yes

String

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

storageType

Yes

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

No

matchLabels object

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

Table 13 matchLabels

Parameter

Mandatory

Type

Description

size

No

String

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

volumeType

No

String

EVS disk type. SSD, GPSSD, SAS, ESSD, and SATA are supported.

metadataEncrypted

No

String

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

metadataCmkid

No

String

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

count

No

String

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

Table 14 StorageGroups

Parameter

Mandatory

Type

Description

name

Yes

String

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

NOTE:
  • If cceManaged is set to true, the name must be set to vgpass.

  • If the data disk is used as a temporary storage volume, the name must be vg-everest-localvolume-ephemeral.

  • If the data disk is used as a persistent storage volume, the name must be vg-everest-localvolume-persistent.

cceManaged

No

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

Yes

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

Yes

Array of VirtualSpace objects

Detailed management of space configuration in a group.

Table 15 VirtualSpace

Parameter

Mandatory

Type

Description

name

Yes

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

Yes

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

No

LVMConfig object

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

runtimeConfig

No

RuntimeConfig object

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

Table 16 LVMConfig

Parameter

Mandatory

Type

Description

lvType

Yes

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

No

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 17 RuntimeConfig

Parameter

Mandatory

Type

Description

lvType

Yes

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.

Table 18 NodePublicIP

Parameter

Mandatory

Type

Description

ids

No

Array of strings

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

NOTE:

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

count

No

Integer

Number of EIPs to be dynamically created.

NOTE:

count and eip must be set at the same time.

eip

No

NodeEIPSpec object

EIP configuration.

Table 19 NodeEIPSpec

Parameter

Mandatory

Type

Description

iptype

Yes

String

EIP type, specified in publicip.type in the API for assigning an EIP.

For details, see Assigning an EIP.

bandwidth

No

NodeBandwidth object

Bandwidth parameters of the EIP

Table 20 NodeBandwidth

Parameter

Mandatory

Type

Description

chargemode

No

String

Bandwidth billing mode.

  • 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 transmission rate (in Mbps) of public networks. This billing mode is recommended if your bandwidth usage is higher than 10%.

  • Billed by traffic: The billing is based on the total amount of data (in GB) transmitted over the public network. This mode is available only when you are creating a pay-per-use node. This billing mode is recommended if your bandwidth usage is lower than 10%.

size

No

Integer

Bandwidth size, specified in bandwidth.size in the API for assigning an EIP.

For details, see Assigning an EIP.

sharetype

No

String

Bandwidth sharing type. Value options: PER (exclusive bandwidth)

Table 21 NodeNicSpec

Parameter

Mandatory

Type

Description

primaryNic

No

NicSpec object

Description of the primary NIC.

extNics

No

Array of NicSpec objects

Extension NIC

NOTE:

This parameter is not supported when you add a node to a node pool.

Table 22 NicSpec

Parameter

Mandatory

Type

Description

subnetId

No

String

Network ID of the subnet to which a NIC belongs. If subnetId is not specified when a primary NIC is creating, the cluster subnet will be used. If subnetList is also configured for a node pool, the subnetList field is used for adding subnets to the node pool. When creating an extension NIC, you must specify subnetId.

fixedIps

No

Array of strings

The IP address of the primary ENI is specified using fixedIps. The number of IP addresses cannot be greater than the number of created nodes. Either fixedIps or ipBlock can be specified. fiexdIps cannot be specified for extension ENIs.

ipBlock

No

String

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

Table 23 Taint

Parameter

Mandatory

Type

Description

key

Yes

String

Key.

value

No

String

Value.

effect

Yes

String

Effect.

Table 24 UserTag

Parameter

Mandatory

Type

Description

key

No

String

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

value

No

String

Value of the cloud server label.

Table 25 Runtime

Parameter

Mandatory

Type

Description

name

No

String

Container runtime. Default value:

  • Clusters earlier than v1.25: The default value is docker.

  • Clusters of v1.25 or later: The default container runtime varies depending on the OS. For nodes running EulerOS 2.5 or EulerOS 2.8, the default container runtime is docker; for nodes running other OSs, the default container runtime is containerd.

Table 26 NodeExtendParam

Parameter

Mandatory

Type

Description

ecs:performancetype

No

String

ECS flavor types. This field is returned in the response.

orderID

No

String

Order ID. This parameter is returned in the response when the node is billed on a yearly/monthly basis with auto payment enabled (only in creation scenarios).

productID

No

String

Product ID. This field is returned in the response when the node is yearly/monthly-billed with auto payment enabled.

maxPods

No

Integer

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 of pods.

The number of pods that can be created on a node is determined by multiple parameters. For details, see Maximum Number of Pods That Can Be Created on a Node.

periodType

No

String

  • month: The unit is month.

  • year: The unit is year.

NOTE:

Request parameter, which is valid and mandatory only when billingMode is set to 1 (yearly/monthly billing) or 2 (yearly/monthly billing with auto renewal enabled) (discarded). Response parameter, which is returned only when a yearly/monthly node is created.

periodNum

No

Integer

Subscription duration. The value can be:

  • If periodType is month, the value ranges from 1 to 9.

  • If periodType is year, the value is 1.

NOTE:

Request parameter, which is valid and mandatory when billingMode is set to 1 or 2 (discarded). Response parameter, which is returned only when a yearly/monthly node is created.

isAutoRenew

No

String

Whether auto renewal is enabled.

  • true: Auto renewal is enabled.

  • false: Auto renewal is not enabled.

NOTE:

This field is valid when billingMode is set to 1 or 2 (discarded). If not specified, auto renewal is not enabled.

isAutoPay

No

String

Whether to deduct fees automatically.

  • true: Enable automatic fee deduction.

  • false: Do not enable automatic fee deduction.

NOTE:

This field is valid when billingMode is set to 1 or 2 (discarded). If not specified when billingMode is set to 1, auto fee deduction is not enabled. (Discarded: If not specified when billingMode is set to 2, auto fee deduction is enabled.)

DockerLVMConfigOverride

No

String

Docker data disk configuration item. (This parameter has been discarded. Use the storage field instead.) Example default configuration:

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

By default, if no VD disk is available, an error occurs because the data disk fails to be found. Set diskType based on the actual drive letter type. The following fields are included:

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

  • userPath (optional): 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. 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

No

Integer

Available disk space of a single container on a node, in GB.

If this parameter is left blank or is set to 0, the default value is used. In Device Mapper mode, the default value is 10. In OverlayFS mode, the available space of a single container is not limited by default, and the dockerBaseSize setting takes effect only on EulerOS nodes in the cluster of the new version.

For details about how to allocate the space for the container runtime, see Data Disk Space Allocation.

When Device Mapper is used, you are advised to set dockerBaseSize to a value less than or equal to 80 GB. If the value is too large, the container runtime may fail to be started due to long initialization. If there are special requirements for the container disk space, you can mount an external or local storage device.

publicKey

No

String

Public key of a node.

alpha.cce/preInstall

No

String

Pre-installation script.

NOTE:

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

alpha.cce/postInstall

No

String

Post-installation script.

NOTE:

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

alpha.cce/NodeImageID

No

String

This parameter is required when a custom image is used to create a BMS node.

nicMultiqueue

No

String

  • Number of ENI queues. Example setting:

"[{\"queue\":4}]"

The following fields are included:

  • queue: number of ENI queues.

  • This field can be configured only for BMS nodes in a CCE Turbo cluster.

  • Supported proportions are {"1":128, "2":92, "4":92, "8":32, "16":16, "28":9}. That is, if there is one queue, a maximum of 128 ENIs can be bound. If there are two queues, a maximum of 92 ENIs can be bound for two queues.

  • A larger number of ENI queues indicates higher performance but fewer ENIs can be bound. The queue settings cannot be changed after the node pool is created.

nicThreshold

No

String

  • ENI pre-binding thresholds. Example setting:

"0.3:0.6"
  • Low threshold (L): determines the minimum number of pre-bound ENIs (Min). Formula: Min = Total number of ENIs of the node x L

  • High threshold (H): determines the maximum number of pre-bound ENIs (Max). Formula: Max = Total number of ENIs of the node x H

  • Number of ENIs bound to a BMS node (B) and number of ENIs being used by pods (U): U + Min < B < U + Max

  • If the number of pre-bound ENIs on a BMS node is smaller than the minimum allowed, the system will bind more ENIs to make the numbers equal.

  • If the number of pre-bound ENIs on a BMS node is larger than the maximum allowed, the system periodically unbinds ENIs (about every 2 minutes) to make the numbers equal.

  • Both the thresholds are one-decimal-place values ranging from 0.0 to 1.0. The low threshold must be smaller than or equal to the high one.

  • This field can be configured only for BMS nodes in a CCE Turbo cluster.

  • Pre-binding ENIs can speed up workload creation but occupies IP addresses.

chargingMode

No

Integer

Billing mode of a node. This parameter has been deprecated. Use the billingMode parameter in NodeSpec.

agency_name

No

String

Name of an agency

An agency is created by a tenant administrator on Identity and Access Management (IAM) to provide temporary credentials for CCE nodes to access cloud servers. This parameter is returned only when it is transferred during node creation.

kubeReservedMem

No

Integer

Reserved node memory, which is reserved for Kubernetes components.

systemReservedMem

No

Integer

Reserved node memory, which is reserved for system components.

init-node-password

No

String

Node password. If this parameter is used as a response parameter, asterisks (*) will be displayed.

Table 27 HostnameConfig

Parameter

Mandatory

Type

Description

type

Yes

String

Configuration type of the Kubernetes node name. The default value is privateIp.

  • privateIp: The Kubernetes node is named after its IP address.

  • cceNodeName: The Kubernetes node is named after the CCE node.

NOTE:
  • For a node which is configured using cceNodeName, the name is the same as the Kubernetes node name and the ECS name. The node name cannot be changed. If the ECS name is changed on the ECS console, the node name will retain unchanged after ECS synchronization.

  • For a node which is configured using cceNodeName, to avoid a conflict between Kubernetes nodes, the system automatically adds a suffix to each node name. The suffix is in the format of A hyphen (-) Five random characters. The value of the random characters is a lowercase letter or a digit ranging from 0 to 9.

Table 28 NodePoolNodeAutoscaling

Parameter

Mandatory

Type

Description

enable

No

Boolean

Whether to enable auto scaling.

minNodeCount

No

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.

maxNodeCount

No

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.

scaleDownCooldownTime

No

Integer

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

priority

No

Integer

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

Table 29 NodeManagement

Parameter

Mandatory

Type

Description

serverGroupReference

No

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 30 SecurityID

Parameter

Mandatory

Type

Description

id

No

String

Security group ID

Table 31 NodePoolStatus

Parameter

Mandatory

Type

Description

currentNode

No

Integer

Total number of nodes in the current node pool (excluding the nodes that are being deleted)

creatingNode

No

Integer

Number of nodes in the creation process in the node pool

deletingNode

No

Integer

Number of nodes being deleted in the current node pool.

phase

No

String

Node pool status.

  • Null: available (the number of current nodes in the node pool has reached the expected value, and no node scaling is being performed.)

  • Synchronizing: scaling in progress (the number of current nodes in the node pool does not reach the expected value and no node scaling is being performed.)

  • Synchronized: pending scaling (the number of current nodes in the node pool does not reach the expected value, or node scaling is being performed.)

  • SoldOut: The node pool cannot be scaled out. (This field is used in multiple scenarios, for example, resources in the node pool have been sold out or the resource quota is insufficient.)

NOTE:

This node pool status has been discarded and is reserved only for compatibility. You are not advised to use it. The replacements are as follows:

  • Node pool scaling status: You can obtain accurate status of the current node pool based on parameters such as currentNode, creatingNode, or deletingNode.

  • Node pool scale-out: You can use conditions to obtain the detailed status of a node pool. Scalable can replace SoldOut.

  • Deleting: The object is being deleted.

  • Error: An error occurs.

jobId

No

String

ID of a job executed on the node pool. This field is available only when the node pool is being deleted.

conditions

No

Array of NodePoolCondition objects

Node pool status details. For details, see the definition of Condition.

Table 32 NodePoolCondition

Parameter

Mandatory

Type

Description

type

No

String

Condition type. The options are as follows:

  • Scalable: whether a node pool can be scaled. If the status is False, node pool scaling will not be triggered again.

  • QuotaInsufficient: Quotas on which node pool scaling depends are insufficient, affecting the node pool scaling status.

  • ResourceInsufficient: Resources on which node pool scaling depends are insufficient, affecting the node pool scaling status.

  • UnexpectedError: The node pool fails to be scaled out due to unexpected reasons, affecting the node pool scaling status.

  • LockedByOrder: The yearly/monthly-billed node pool is locked due to an order. The value of Reason is the ID of the pending order.

  • Error: A node pool error occurs. A common trigger is deletion failure.

status

No

String

Current status of Condition. The options are as follows:

  • "True"

  • "False"

lastProbeTime

No

String

Time when the status was last checked

lastTransitTime

No

String

Time when the status was last changed

reason

No

String

Reason why the status was last changed

message

No

String

Detailed condition description

Response Parameters

Status code: 201

Table 33 Response body parameters

Parameter

Type

Description

kind

String

API type. The value is fixed at NodePool.

apiVersion

String

API version. The value is fixed at v3.

metadata

NodePoolMetadata object

Metadata of the node pool.

spec

NodePoolSpec object

Node pool specifications.

status

CreateNodePoolStatus object

Node pool status.

Table 34 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.

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.

annotations

Map<String,String>

Annotations of a node pool in key-value pairs. This parameter is used only for query and cannot be input through a request. Entered data of this parameter is invalid.

updateTimestamp

String

Update time.

creationTimestamp

String

Creation time.

Table 35 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: C6 general computing-plus BMS. An example flavor is c6.22xlarge.2.physical.

  • bms: BMS

nodeTemplate

NodeSpec object

Detailed parameters of the node pool template.

initialNodeCount

Integer

Initial number of nodes for the node pool. When queried, the value is the number of target nodes in the node pool.

autoscaling

NodePoolNodeAutoscaling object

Auto scaling parameters

nodeManagement

NodeManagement object

Node management configuration

podSecurityGroups

Array of SecurityID objects

Security group configuration. This parameter is available only for CCE Turbo clusters.

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.

Table 36 NodeSpec

Parameter

Type

Description

flavor

String

Node specifications. For details about the node specifications supported by CCE, see Node Flavor Description.

az

String

Name of the AZ where the node to be created is located. . For details about AZs supported by CCE, see Regions and Endpoints.

os

String

The OS type of the node. For details about the supported OSs, see [Node OS Description] (node-os.xml).

NOTE:
  • The system automatically selects the supported OS based on the cluster version. If the current cluster does not support the OS, an error will be reported.

  • If alpha.cce/NodeImageID in extendParam is specified during node creation, you do not need to configure this parameter.

  • This parameter is mandatory when creating a node pool.

login

Login object

Node login mode. Either the key pair or password must be used for login.

rootVolume

Volume object

Information about disks on 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. This data disk is used by the container runtime and kubelet. Do not uninstall this disk. Otherwise, the node will become unavailable. For DeC nodes, the parameter description is the same as that for rootVolume.

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

NodePublicIP object

EIP of a node.

NOTE:

This parameter is not supported when you add a node to a node pool.

nodeNicSpec

NodeNicSpec object

NIC 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 parameter can be left blank when it is used for a node pool.

billingMode

Integer

Node billing mode.

  • 0: pay-per-use

  • 1: yearly/monthly

  • 2: (discarded) yearly/monthly billing with auto payment enabled

taints

Array of Taint objects

You can add taints to created nodes to configure anti-affinity. A maximum of 20 taints can be added. Each taint contains the following parameters:

  • Key: A key must contain 1 to 63 characters starting with a letter or digit. Only letters, digits, hyphens (-), underscores (_), and periods (.) are allowed. A DNS subdomain name can be used as the prefix of a key.

  • Value: A 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. When creating a node, you can specify the initial value for this parameter and this field is not returned during query. In using node pools, the initial value can be specified in the node template and this field is returned during query. In other scenarios, this field is not returned during query.

Example:

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

k8sTags

Map<String,String>

Defined in key-value pairs. A maximum of 20 key-value pairs are allowed.

  • 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. When creating a node, you can specify the initial value for this parameter and this field is not returned during query. In using node pools, the initial value can be specified in the node template and this field is returned during query. In other scenarios, this field is not returned during query.

Example:

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

ecsGroupId

String

ECS group ID. If this parameter is configured, nodes will be created in the specified ECS group.

NOTE:

This configuration does not take effect when a node pool is created. To ensure that all nodes in a node pool are in the same ECS group, configure nodeManagement in the node pool.

dedicatedHostId

String

ID of the DeH to which the node is scheduled.

NOTE:

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

userTags

Array of UserTag objects

Cloud server tag. The key of a tag must be unique. The maximum number of custom tags supported by CCE depends on the region and cannot exceed 8. When creating a node, you can specify the initial value for this parameter and this field is not returned during query. In using node pools, the initial value can be specified in the node template and this field is returned during query. In other scenarios, this field is not returned during query.

NOTE:

Use only letters, Unicode characters, digits, special characters(-,_). Max characters: 36

runtime

Runtime object

Container runtime:

  • Clusters of v1.25 or earlier: docker.

  • Clusters of v1.25 or later: Container runtime varies with the OS. For nodes running EulerOS 2.5 or EulerOS 2.8, the default container runtime is docker. For nodes running other OSs, the default container runtime is containerd.

initializedConditions

Array of strings

Custom initialization flag, which is left blank by default.

Before CCE nodes are initialized, node.cloudprovider.kubernetes.io/uninitialized is added to the nodes to prevent pods from being scheduled to these nodes. When creating a node, you can configure the initializedConditions parameter to control the taint removal time. By default, the timeout period is not configured.

Example:

  1. Create a node and add parameter "initializedConditions": ["CCEInitial", "CustomedInitial"].

  2. After custom initialization is complete, CCE will call a Kubernetes API (for example, PATCH /v1/nodes/{node_ip}/status) to update the node conditions by adding two labels of types CCEInitial and CustomedInitial and setting the status to True, as shown in the following:

status:
  conditions:
  - type: CCEInitial
    status: 'True'
  - type: CustomedInitial
    status: 'True'
  1. CCE polls status.Conditions of nodes to check whether there are conditions of types CCEInitial and CustomedInitial. If such conditions exist and the status is True, the node initialization is complete and the initialization taint is removed.

  2. initializedConditions allows you to configure a timeout period during node creation. For example, "initializedConditions": ["CCEInitial:15m", "CustomedInitial:15m"] indicates that the timeout period is 15 minutes. After the timeout period is reached, the initialization conditions will be automatically ignored and the initialization taint will be removed when CCE polls the node.

  • Use only letters and digits. Max. characters: 20.

  • Max. flags: 2.

  • The unit of the timeout period is minute (m).

extendParam

NodeExtendParam object

Extended parameters for creating a node.

hostnameConfig

HostnameConfig object

Kubernetes node name configuration parameter, which is supported by clusters of v1.23.6-r0 to v1.25 or clusters of v1.25.2-r0 or later versions.

Table 37 Login

Parameter

Type

Description

sshKey

String

Name of the key pair used for login.

userPassword

UserPassword object

Password used for node login.

Table 38 UserPassword

Parameter

Type

Description

username

String

Login account. Defaults to root.

password

String

If a username and a password are used to create a node, this field is shielded in the response body. A password must meet the following complexity requirements:

  • Contains 8 to 26 characters.

  • Contains at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters (!@$%^-_=+[{}]:,./?~#*)

  • Cannot contain the username or the username spelled backwards. The password field must be salted during node creation. For details, see Adding a Salt in the password Field When Creating a Node.

Table 39 Volume

Parameter

Type

Description

size

Integer

Disk size, in GB.

  • System disk: 40 to 1024 -Value range for data disks: 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.

  • SAS: high I/O SAS disk

  • SSD: ultra-high I/O SSD disk

  • SATA: common I/O SATA disk SATA disks have been removed from EVS. You can find them attached only on existing nodes.

extendParam

Map<String,Object>

Extended disk parameters, defined in extendparam in the API used to create an ECS.

For details, see Creating an ECS.

cluster_id

String

ID of the storage pool used by the ECS system disk. This field is used only for DeC clusters, which functions as dssPoolID, that is, the ID of the DSS storage pool.

To obtain the value, see the ID field in the API used to obtain details of a DSS storage pool.

cluster_type

String

Storage class of the cloud server system disk. The value is always dss. This field is used only for DeC clusters.

hw:passthrough

Boolean

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

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

  • If a node specification involves local disks and EVS disks at the same time, set the disk initialization parameters. For details, see Attaching Disks to a Node.

metadata

VolumeMetadata object

EVS disk encryption information. This field is mandatory only when you need to encrypt the system disk or data disks of the node to be created.

Table 40 VolumeMetadata

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 parameter is not specified, EVS disks will not be encrypted by default.

__system__cmkid

String

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

Table 41 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 42 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 43 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. SSD, GPSSD, SAS, ESSD, and SATA are supported.

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 44 StorageGroups

Parameter

Type

Description

name

String

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

NOTE:
  • If cceManaged is set to true, the name must be set to vgpass.

  • If the data disk is used as a temporary storage volume, the name must be vg-everest-localvolume-ephemeral.

  • If the data disk is used as a persistent storage volume, the name must be vg-everest-localvolume-persistent.

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 45 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 46 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 47 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.

Table 48 NodePublicIP

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 ids has been set, you do not need to set count and eip.

count

Integer

Number of EIPs to be dynamically created.

NOTE:

count and eip must be set at the same time.

eip

NodeEIPSpec object

EIP configuration.

Table 49 NodeEIPSpec

Parameter

Type

Description

iptype

String

EIP type, specified in publicip.type in the API for assigning an EIP.

For details, see Assigning an EIP.

bandwidth

NodeBandwidth object

Bandwidth parameters of the EIP

Table 50 NodeBandwidth

Parameter

Type

Description

chargemode

String

Bandwidth billing mode.

  • 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 transmission rate (in Mbps) of public networks. This billing mode is recommended if your bandwidth usage is higher than 10%.

  • Billed by traffic: The billing is based on the total amount of data (in GB) transmitted over the public network. This mode is available only when you are creating a pay-per-use node. This billing mode is recommended if your bandwidth usage is lower than 10%.

size

Integer

Bandwidth size, specified in bandwidth.size in the API for assigning an EIP.

For details, see Assigning an EIP.

sharetype

String

Bandwidth sharing type. Value options: PER (exclusive bandwidth)

Table 51 NodeNicSpec

Parameter

Type

Description

primaryNic

NicSpec object

Description of the primary NIC.

extNics

Array of NicSpec objects

Extension NIC

NOTE:

This parameter is not supported when you add a node to a node pool.

Table 52 NicSpec

Parameter

Type

Description

subnetId

String

Network ID of the subnet to which a NIC belongs. If subnetId is not specified when a primary NIC is creating, the cluster subnet will be used. If subnetList is also configured for a node pool, the subnetList field is used for adding subnets to the node pool. When creating an extension NIC, you must specify subnetId.

fixedIps

Array of strings

The IP address of the primary ENI is specified using fixedIps. The number of IP addresses cannot be greater than the number of created nodes. Either fixedIps or ipBlock can be specified. fiexdIps cannot be specified for extension ENIs.

ipBlock

String

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

Table 53 Taint

Parameter

Type

Description

key

String

Key.

value

String

Value.

effect

String

Effect.

Table 54 UserTag

Parameter

Type

Description

key

String

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

value

String

Value of the cloud server label.

Table 55 Runtime

Parameter

Type

Description

name

String

Container runtime. Default value:

  • Clusters earlier than v1.25: The default value is docker.

  • Clusters of v1.25 or later: The default container runtime varies depending on the OS. For nodes running EulerOS 2.5 or EulerOS 2.8, the default container runtime is docker; for nodes running other OSs, the default container runtime is containerd.

Table 56 NodeExtendParam

Parameter

Type

Description

ecs:performancetype

String

ECS flavor types. This field is returned in the response.

orderID

String

Order ID. This parameter is returned in the response when the node is billed on a yearly/monthly basis with auto payment enabled (only in creation scenarios).

productID

String

Product ID. This field is returned in the response when the node is yearly/monthly-billed with auto payment enabled.

maxPods

Integer

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 of pods.

The number of pods that can be created on a node is determined by multiple parameters. For details, see Maximum Number of Pods That Can Be Created on a Node.

periodType

String

  • month: The unit is month.

  • year: The unit is year.

NOTE:

Request parameter, which is valid and mandatory only when billingMode is set to 1 (yearly/monthly billing) or 2 (yearly/monthly billing with auto renewal enabled) (discarded). Response parameter, which is returned only when a yearly/monthly node is created.

periodNum

Integer

Subscription duration. The value can be:

  • If periodType is month, the value ranges from 1 to 9.

  • If periodType is year, the value is 1.

NOTE:

Request parameter, which is valid and mandatory when billingMode is set to 1 or 2 (discarded). Response parameter, which is returned only when a yearly/monthly node is created.

isAutoRenew

String

Whether auto renewal is enabled.

  • true: Auto renewal is enabled.

  • false: Auto renewal is not enabled.

NOTE:

This field is valid when billingMode is set to 1 or 2 (discarded). If not specified, auto renewal is not enabled.

isAutoPay

String

Whether to deduct fees automatically.

  • true: Enable automatic fee deduction.

  • false: Do not enable automatic fee deduction.

NOTE:

This field is valid when billingMode is set to 1 or 2 (discarded). If not specified when billingMode is set to 1, auto fee deduction is not enabled. (Discarded: If not specified when billingMode is set to 2, auto fee deduction is enabled.)

DockerLVMConfigOverride

String

Docker data disk configuration item. (This parameter has been discarded. Use the storage field instead.) Example default configuration:

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

By default, if no VD disk is available, an error occurs because the data disk fails to be found. Set diskType based on the actual drive letter type. The following fields are included:

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

  • userPath (optional): 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. 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

Integer

Available disk space of a single container on a node, in GB.

If this parameter is left blank or is set to 0, the default value is used. In Device Mapper mode, the default value is 10. In OverlayFS mode, the available space of a single container is not limited by default, and the dockerBaseSize setting takes effect only on EulerOS nodes in the cluster of the new version.

For details about how to allocate the space for the container runtime, see Data Disk Space Allocation.

When Device Mapper is used, you are advised to set dockerBaseSize to a value less than or equal to 80 GB. If the value is too large, the container runtime may fail to be started due to long initialization. If there are special requirements for the container disk space, you can mount an external or local storage device.

publicKey

String

Public key of a node.

alpha.cce/preInstall

String

Pre-installation script.

NOTE:

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

alpha.cce/postInstall

String

Post-installation script.

NOTE:

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

alpha.cce/NodeImageID

String

This parameter is required when a custom image is used to create a BMS node.

nicMultiqueue

String

  • Number of ENI queues. Example setting:

"[{\"queue\":4}]"

The following fields are included:

  • queue: number of ENI queues.

  • This field can be configured only for BMS nodes in a CCE Turbo cluster.

  • Supported proportions are {"1":128, "2":92, "4":92, "8":32, "16":16, "28":9}. That is, if there is one queue, a maximum of 128 ENIs can be bound. If there are two queues, a maximum of 92 ENIs can be bound for two queues.

  • A larger number of ENI queues indicates higher performance but fewer ENIs can be bound. The queue settings cannot be changed after the node pool is created.

nicThreshold

String

  • ENI pre-binding thresholds. Example setting:

"0.3:0.6"
  • Low threshold (L): determines the minimum number of pre-bound ENIs (Min). Formula: Min = Total number of ENIs of the node x L

  • High threshold (H): determines the maximum number of pre-bound ENIs (Max). Formula: Max = Total number of ENIs of the node x H

  • Number of ENIs bound to a BMS node (B) and number of ENIs being used by pods (U): U + Min < B < U + Max

  • If the number of pre-bound ENIs on a BMS node is smaller than the minimum allowed, the system will bind more ENIs to make the numbers equal.

  • If the number of pre-bound ENIs on a BMS node is larger than the maximum allowed, the system periodically unbinds ENIs (about every 2 minutes) to make the numbers equal.

  • Both the thresholds are one-decimal-place values ranging from 0.0 to 1.0. The low threshold must be smaller than or equal to the high one.

  • This field can be configured only for BMS nodes in a CCE Turbo cluster.

  • Pre-binding ENIs can speed up workload creation but occupies IP addresses.

chargingMode

Integer

Billing mode of a node. This parameter has been deprecated. Use the billingMode parameter in NodeSpec.

agency_name

String

Name of an agency

An agency is created by a tenant administrator on Identity and Access Management (IAM) to provide temporary credentials for CCE nodes to access cloud servers. This parameter is returned only when it is transferred during node creation.

kubeReservedMem

Integer

Reserved node memory, which is reserved for Kubernetes components.

systemReservedMem

Integer

Reserved node memory, which is reserved for system components.

init-node-password

String

Node password. If this parameter is used as a response parameter, asterisks (*) will be displayed.

Table 57 HostnameConfig

Parameter

Type

Description

type

String

Configuration type of the Kubernetes node name. The default value is privateIp.

  • privateIp: The Kubernetes node is named after its IP address.

  • cceNodeName: The Kubernetes node is named after the CCE node.

NOTE:
  • For a node which is configured using cceNodeName, the name is the same as the Kubernetes node name and the ECS name. The node name cannot be changed. If the ECS name is changed on the ECS console, the node name will retain unchanged after ECS synchronization.

  • For a node which is configured using cceNodeName, to avoid a conflict between Kubernetes nodes, the system automatically adds a suffix to each node name. The suffix is in the format of A hyphen (-) Five random characters. The value of the random characters is a lowercase letter or a digit ranging from 0 to 9.

Table 58 NodePoolNodeAutoscaling

Parameter

Type

Description

enable

Boolean

Whether to enable auto scaling.

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.

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.

scaleDownCooldownTime

Integer

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

priority

Integer

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

Table 59 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 60 SecurityID

Parameter

Type

Description

id

String

Security group ID

Table 61 CreateNodePoolStatus

Parameter

Type

Description

currentNode

Integer

Total number of nodes in the current node pool (excluding the nodes that are being deleted).

creatingNode

Integer

Number of nodes that are being created in the node pool.

deletingNode

Integer

Number of nodes that are being deleted in the current node pool.

phase

String

Node pool status. Options:

  • Null: The node pool is available. (The number of nodes in the current node pool has reached the expected value, and no node scaling is being performed.)

  • Synchronizing: The node pool is being scaled. (The number of nodes in the current node pool has not reached the expected value, and no node scaling is being performed.)

  • Synchronized: The node pool scaling is pending. (The number of nodes in the current node pool has not reached the expected value, or node scaling is being performed.)

  • SoldOut: The node pool cannot be scaled out. (This field is used in multiple scenarios, for example, resources in the node pool have been sold out or the resource quota is insufficient.)

NOTE:

This node pool status has been deprecated. It is reserved only for compatibility. Do not use it anymore. Use the following instead:

  • Node pool scaling status: You can obtain the status of the current node pool using parameters such as currentNode, creatingNode, or deletingNode.

  • Node pool scale-out: You can use conditions to obtain the detailed status of a node pool. Scalable can replace SoldOut.

  • Deleting: The node pool is being deleted.

  • Error: An error occurred in the node pool.

conditions

Array of NodePoolCondition objects

Node pool status details. For details, see the definition of Condition.

Table 62 NodePoolCondition

Parameter

Type

Description

type

String

Condition type. The options are as follows:

  • Scalable: whether a node pool can be scaled. If the status is False, node pool scaling will not be triggered again.

  • QuotaInsufficient: Quotas on which node pool scaling depends are insufficient, affecting the node pool scaling status.

  • ResourceInsufficient: Resources on which node pool scaling depends are insufficient, affecting the node pool scaling status.

  • UnexpectedError: The node pool fails to be scaled out due to unexpected reasons, affecting the node pool scaling status.

  • LockedByOrder: The yearly/monthly-billed node pool is locked due to an order. The value of Reason is the ID of the pending order.

  • Error: A node pool error occurs. A common trigger is deletion failure.

status

String

Current status of Condition. The options are as follows:

  • "True"

  • "False"

lastProbeTime

String

Time when the status was last checked

lastTransitTime

String

Time when the status was last changed

reason

String

Reason why the status was last changed

message

String

Detailed condition description

Example Requests

Create a node pool billed on a pay-per-use basis with the following configurations: The number of nodes is 0. The node pool flavor is 2 vCPUs and 4 GiB of memory. The node OS is EulerOS 2.5. Docker containers are deployed. The sizes of the system disk and data disk of the node are 40 GB and 100 GB, respectively. Both the disks are of the high I/O type.

{
  "kind" : "NodePool",
  "apiVersion" : "v3",
  "metadata" : {
    "name" : "lc-it-nodepool-79796"
  },
  "spec" : {
    "initialNodeCount" : 0,
    "type" : "vm",
    "autoscaling" : {
      "enable" : false,
      "minNodeCount" : 0,
      "maxNodeCount" : 1,
      "scaleDownCooldownTime" : 0,
      "priority" : 0
    },
    "nodeManagement" : {
      "serverGroupReference" : ""
    },
    "nodeTemplate" : {
      "flavor" : "s6.large.2",
      "az" : "******",
      "os" : "EulerOS 2.5",
      "login" : {
        "sshKey" : "KeyPair-001"
      },
      "rootVolume" : {
        "volumetype" : "SAS",
        "size" : 40
      },
      "dataVolumes" : [ {
        "volumetype" : "SAS",
        "size" : 100,
        "extendParam" : {
          "useType" : "docker"
        }
      } ],
      "billingMode" : 0,
      "extendParam" : {
        "alpha.cce/preInstall" : "",
        "alpha.cce/postInstall" : "",
        "alpha.cce/NodeImageID" : "",
        "maxPods" : 110
      },
      "nodeNicSpec" : {
        "primaryNic" : {
          "subnetId" : "7e767d10-7548-4df5-ad72-aeac1d08bd8a"
        }
      }
    },
    "podSecurityGroups" : [ {
      "id" : ""
    } ]
  }
}

Example Responses

Status code: 201

The job for creating a node pool in a specified cluster is successfully delivered.

{
  "kind" : "NodePool",
  "apiVersion" : "v3",
  "metadata" : {
    "name" : "lc-it-nodepool-79796",
    "uid" : "99addaa2-69eb-11ea-a592-0255ac1001bb"
  },
  "spec" : {
    "type" : "vm",
    "nodeTemplate" : {
      "flavor" : "s6.large.2",
      "az" : "******",
      "os" : "EulerOS 2.5",
      "login" : {
        "sshKey" : "KeyPair-001"
      },
      "rootVolume" : {
        "volumetype" : "SAS",
        "size" : 40
      },
      "dataVolumes" : [ {
        "volumetype" : "SAS",
        "size" : 100,
        "extendParam" : {
          "useType" : "docker"
        }
      } ],
      "publicIP" : {
        "eip" : {
          "bandwidth" : { }
        }
      },
      "nodeNicSpec" : {
        "primaryNic" : {
          "subnetId" : "7e767d10-7548-4df5-ad72-aeac1d08bd8a"
        }
      },
      "billingMode" : 0,
      "extendParam" : {
        "alpha.cce/NodeImageID" : "",
        "alpha.cce/postInstall" : "",
        "alpha.cce/preInstall" : "",
        "maxPods" : 110
      },
      "k8sTags" : {
        "cce.cloud.com/cce-nodepool" : "lc-it-nodepool-79796"
      }
    },
    "autoscaling" : {
      "maxNodeCount" : 1
    },
    "nodeManagement" : { }
  },
  "status" : {
    "phase" : ""
  }
}

SDK Sample Code

The SDK sample code is as follows.

Create a node pool billed on a pay-per-use basis with the following configurations: The number of nodes is 0. The node pool flavor is 2 vCPUs and 4 GiB of memory. The node OS is EulerOS 2.5. Docker containers are deployed. The sizes of the system disk and data disk of the node are 40 GB and 100 GB, respectively. Both the disks are of the high I/O type.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
package com.huaweicloud.sdk.test;

import com.huaweicloud.sdk.core.auth.ICredential;
import com.huaweicloud.sdk.core.auth.BasicCredentials;
import com.huaweicloud.sdk.core.exception.ConnectionException;
import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
import com.huaweicloud.sdk.core.exception.ServiceResponseException;
import com.huaweicloud.sdk.cce.v3.region.CceRegion;
import com.huaweicloud.sdk.cce.v3.*;
import com.huaweicloud.sdk.cce.v3.model.*;

import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;

public class CreateNodePoolSolution {

    public static void main(String[] args) {
        // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
        // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
        String ak = System.getenv("CLOUD_SDK_AK");
        String sk = System.getenv("CLOUD_SDK_SK");

        ICredential auth = new BasicCredentials()
                .withAk(ak)
                .withSk(sk);

        CceClient client = CceClient.newBuilder()
                .withCredential(auth)
                .withRegion(CceRegion.valueOf("<YOUR REGION>"))
                .build();
        CreateNodePoolRequest request = new CreateNodePoolRequest();
        NodePool body = new NodePool();
        List<SecurityID> listSpecPodSecurityGroups = new ArrayList<>();
        listSpecPodSecurityGroups.add(
            new SecurityID()
                .withId("")
        );
        NodeManagement nodeManagementSpec = new NodeManagement();
        nodeManagementSpec.withServerGroupReference("");
        NodePoolNodeAutoscaling autoscalingSpec = new NodePoolNodeAutoscaling();
        autoscalingSpec.withEnable(false)
            .withMinNodeCount(0)
            .withMaxNodeCount(1)
            .withScaleDownCooldownTime(0)
            .withPriority(0);
        NodeExtendParam extendParamNodeTemplate = new NodeExtendParam();
        extendParamNodeTemplate.withMaxPods(110)
            .withAlphaCcePreInstall("")
            .withAlphaCcePostInstall("")
            .withAlphaCceNodeImageID("");
        NicSpec primaryNicNodeNicSpec = new NicSpec();
        primaryNicNodeNicSpec.withSubnetId("7e767d10-7548-4df5-ad72-aeac1d08bd8a");
        NodeNicSpec nodeNicSpecNodeTemplate = new NodeNicSpec();
        nodeNicSpecNodeTemplate.withPrimaryNic(primaryNicNodeNicSpec);
        Map<String, Object> listDataVolumesExtendParam = new HashMap<>();
        listDataVolumesExtendParam.put("useType", "docker");
        List<Volume> listNodeTemplateDataVolumes = new ArrayList<>();
        listNodeTemplateDataVolumes.add(
            new Volume()
                .withSize(100)
                .withVolumetype("SAS")
                .withExtendParam(listDataVolumesExtendParam)
        );
        Volume rootVolumeNodeTemplate = new Volume();
        rootVolumeNodeTemplate.withSize(40)
            .withVolumetype("SAS");
        Login loginNodeTemplate = new Login();
        loginNodeTemplate.withSshKey("KeyPair-001");
        NodeSpec nodeTemplateSpec = new NodeSpec();
        nodeTemplateSpec.withFlavor("s6.large.2")
            .withAz("******")
            .withOs("EulerOS 2.5")
            .withLogin(loginNodeTemplate)
            .withRootVolume(rootVolumeNodeTemplate)
            .withDataVolumes(listNodeTemplateDataVolumes)
            .withNodeNicSpec(nodeNicSpecNodeTemplate)
            .withBillingMode(0)
            .withExtendParam(extendParamNodeTemplate);
        NodePoolSpec specbody = new NodePoolSpec();
        specbody.withType(NodePoolSpec.TypeEnum.fromValue("vm"))
            .withNodeTemplate(nodeTemplateSpec)
            .withInitialNodeCount(0)
            .withAutoscaling(autoscalingSpec)
            .withNodeManagement(nodeManagementSpec)
            .withPodSecurityGroups(listSpecPodSecurityGroups);
        NodePoolMetadata metadatabody = new NodePoolMetadata();
        metadatabody.withName("lc-it-nodepool-79796");
        body.withSpec(specbody);
        body.withMetadata(metadatabody);
        body.withApiVersion("v3");
        body.withKind("NodePool");
        request.withBody(body);
        try {
            CreateNodePoolResponse response = client.createNodePool(request);
            System.out.println(response.toString());
        } catch (ConnectionException e) {
            e.printStackTrace();
        } catch (RequestTimeoutException e) {
            e.printStackTrace();
        } catch (ServiceResponseException e) {
            e.printStackTrace();
            System.out.println(e.getHttpStatusCode());
            System.out.println(e.getRequestId());
            System.out.println(e.getErrorCode());
            System.out.println(e.getErrorMsg());
        }
    }
}

Create a node pool billed on a pay-per-use basis with the following configurations: The number of nodes is 0. The node pool flavor is 2 vCPUs and 4 GiB of memory. The node OS is EulerOS 2.5. Docker containers are deployed. The sizes of the system disk and data disk of the node are 40 GB and 100 GB, respectively. Both the disks are of the high I/O type.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
# coding: utf-8

from huaweicloudsdkcore.auth.credentials import BasicCredentials
from huaweicloudsdkcce.v3.region.cce_region import CceRegion
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkcce.v3 import *

if __name__ == "__main__":
    # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
    ak = __import__('os').getenv("CLOUD_SDK_AK")
    sk = __import__('os').getenv("CLOUD_SDK_SK")

    credentials = BasicCredentials(ak, sk) \

    client = CceClient.new_builder() \
        .with_credentials(credentials) \
        .with_region(CceRegion.value_of("<YOUR REGION>")) \
        .build()

    try:
        request = CreateNodePoolRequest()
        listPodSecurityGroupsSpec = [
            SecurityID(
                id=""
            )
        ]
        nodeManagementSpec = NodeManagement(
            server_group_reference=""
        )
        autoscalingSpec = NodePoolNodeAutoscaling(
            enable=False,
            min_node_count=0,
            max_node_count=1,
            scale_down_cooldown_time=0,
            priority=0
        )
        extendParamNodeTemplate = NodeExtendParam(
            max_pods=110,
            alpha_cce_pre_install="",
            alpha_cce_post_install="",
            alpha_cce_node_image_id=""
        )
        primaryNicNodeNicSpec = NicSpec(
            subnet_id="7e767d10-7548-4df5-ad72-aeac1d08bd8a"
        )
        nodeNicSpecNodeTemplate = NodeNicSpec(
            primary_nic=primaryNicNodeNicSpec
        )
        listExtendParamDataVolumes = {
            "useType": "docker"
        }
        listDataVolumesNodeTemplate = [
            Volume(
                size=100,
                volumetype="SAS",
                extend_param=listExtendParamDataVolumes
            )
        ]
        rootVolumeNodeTemplate = Volume(
            size=40,
            volumetype="SAS"
        )
        loginNodeTemplate = Login(
            ssh_key="KeyPair-001"
        )
        nodeTemplateSpec = NodeSpec(
            flavor="s6.large.2",
            az="******",
            os="EulerOS 2.5",
            login=loginNodeTemplate,
            root_volume=rootVolumeNodeTemplate,
            data_volumes=listDataVolumesNodeTemplate,
            node_nic_spec=nodeNicSpecNodeTemplate,
            billing_mode=0,
            extend_param=extendParamNodeTemplate
        )
        specbody = NodePoolSpec(
            type="vm",
            node_template=nodeTemplateSpec,
            initial_node_count=0,
            autoscaling=autoscalingSpec,
            node_management=nodeManagementSpec,
            pod_security_groups=listPodSecurityGroupsSpec
        )
        metadatabody = NodePoolMetadata(
            name="lc-it-nodepool-79796"
        )
        request.body = NodePool(
            spec=specbody,
            metadata=metadatabody,
            api_version="v3",
            kind="NodePool"
        )
        response = client.create_node_pool(request)
        print(response)
    except exceptions.ClientRequestException as e:
        print(e.status_code)
        print(e.request_id)
        print(e.error_code)
        print(e.error_msg)

Create a node pool billed on a pay-per-use basis with the following configurations: The number of nodes is 0. The node pool flavor is 2 vCPUs and 4 GiB of memory. The node OS is EulerOS 2.5. Docker containers are deployed. The sizes of the system disk and data disk of the node are 40 GB and 100 GB, respectively. Both the disks are of the high I/O type.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
package main

import (
	"fmt"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
    cce "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cce/v3"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cce/v3/model"
    region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cce/v3/region"
)

func main() {
    // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
    ak := os.Getenv("CLOUD_SDK_AK")
    sk := os.Getenv("CLOUD_SDK_SK")

    auth := basic.NewCredentialsBuilder().
        WithAk(ak).
        WithSk(sk).
        Build()

    client := cce.NewCceClient(
        cce.CceClientBuilder().
            WithRegion(region.ValueOf("<YOUR REGION>")).
            WithCredential(auth).
            Build())

    request := &model.CreateNodePoolRequest{}
	idPodSecurityGroups:= ""
	var listPodSecurityGroupsSpec = []model.SecurityId{
        {
            Id: &idPodSecurityGroups,
        },
    }
	serverGroupReferenceNodeManagement:= ""
	nodeManagementSpec := &model.NodeManagement{
		ServerGroupReference: &serverGroupReferenceNodeManagement,
	}
	enableAutoscaling:= false
	minNodeCountAutoscaling:= int32(0)
	maxNodeCountAutoscaling:= int32(1)
	scaleDownCooldownTimeAutoscaling:= int32(0)
	priorityAutoscaling:= int32(0)
	autoscalingSpec := &model.NodePoolNodeAutoscaling{
		Enable: &enableAutoscaling,
		MinNodeCount: &minNodeCountAutoscaling,
		MaxNodeCount: &maxNodeCountAutoscaling,
		ScaleDownCooldownTime: &scaleDownCooldownTimeAutoscaling,
		Priority: &priorityAutoscaling,
	}
	maxPodsExtendParam:= int32(110)
	alphaCcePreInstallExtendParam:= ""
	alphaCcePostInstallExtendParam:= ""
	alphaCceNodeImageIDExtendParam:= ""
	extendParamNodeTemplate := &model.NodeExtendParam{
		MaxPods: &maxPodsExtendParam,
		AlphaCcePreInstall: &alphaCcePreInstallExtendParam,
		AlphaCcePostInstall: &alphaCcePostInstallExtendParam,
		AlphaCceNodeImageID: &alphaCceNodeImageIDExtendParam,
	}
	subnetIdPrimaryNic:= "7e767d10-7548-4df5-ad72-aeac1d08bd8a"
	primaryNicNodeNicSpec := &model.NicSpec{
		SubnetId: &subnetIdPrimaryNic,
	}
	nodeNicSpecNodeTemplate := &model.NodeNicSpec{
		PrimaryNic: primaryNicNodeNicSpec,
	}
	var listExtendParamDataVolumes = map[string]interface{}{
        "useType": "docker",
    }
	var listDataVolumesNodeTemplate = []model.Volume{
        {
            Size: int32(100),
            Volumetype: "SAS",
            ExtendParam: listExtendParamDataVolumes,
        },
    }
	rootVolumeNodeTemplate := &model.Volume{
		Size: int32(40),
		Volumetype: "SAS",
	}
	sshKeyLogin:= "KeyPair-001"
	loginNodeTemplate := &model.Login{
		SshKey: &sshKeyLogin,
	}
	osNodeTemplate:= "EulerOS 2.5"
	billingModeNodeTemplate:= int32(0)
	nodeTemplateSpec := &model.NodeSpec{
		Flavor: "s6.large.2",
		Az: "******",
		Os: &osNodeTemplate,
		Login: loginNodeTemplate,
		RootVolume: rootVolumeNodeTemplate,
		DataVolumes: listDataVolumesNodeTemplate,
		NodeNicSpec: nodeNicSpecNodeTemplate,
		BillingMode: &billingModeNodeTemplate,
		ExtendParam: extendParamNodeTemplate,
	}
	typeSpec:= model.GetNodePoolSpecTypeEnum().VM
	initialNodeCountSpec:= int32(0)
	specbody := &model.NodePoolSpec{
		Type: &typeSpec,
		NodeTemplate: nodeTemplateSpec,
		InitialNodeCount: &initialNodeCountSpec,
		Autoscaling: autoscalingSpec,
		NodeManagement: nodeManagementSpec,
		PodSecurityGroups: &listPodSecurityGroupsSpec,
	}
	metadatabody := &model.NodePoolMetadata{
		Name: "lc-it-nodepool-79796",
	}
	request.Body = &model.NodePool{
		Spec: specbody,
		Metadata: metadatabody,
		ApiVersion: "v3",
		Kind: "NodePool",
	}
	response, err := client.CreateNodePool(request)
	if err == nil {
        fmt.Printf("%+v\n", response)
    } else {
        fmt.Println(err)
    }
}

For SDK sample code of more programming languages, see the Sample Code tab in API Explorer. SDK sample code can be automatically generated.

Status Codes

Status Code

Description

201

The job for creating a node pool in a specified cluster is successfully delivered.

Error Codes

See Error Codes.