Creating a Node

Function

This API is used to create a node in a specified cluster.

If no cluster is available, create a cluster first.

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.

Constraints

Only KVM nodes can be created. Non-KVM nodes cannot be used after being created.

URI

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

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

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

cluster_id

Yes

String

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

Table 2 Query parameters

Parameter

Mandatory

Type

Description

nodepoolScaleUp

No

String

Whether the request is delivered by the node pool. If the value is not NodepoolScaleUp, the number of pods in the corresponding node pool is automatically updated.

Enumeration values:

  • NodepoolScaleUp

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

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 field is mandatory and must be set to a user token. For details about how to obtain a token, see Authentication.

Maximum: 16384

Table 4 Request body parameters

Parameter

Mandatory

Type

Description

kind

Yes

String

API type. The value is fixed at Node and cannot be changed.

Default: Node

apiVersion

Yes

String

API version. The value is fixed at v3 and cannot be changed.

Default: v3

metadata

No

NodeMetadata object

Node metadata, which is a collection of attributes.

spec

Yes

V3NodeSpec object

Detailed description of the node object. CCE creates or updates objects by defining or updating spec.

Table 5 NodeMetadata

Parameter

Mandatory

Type

Description

name

No

String

Node name.

NOTE:

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

Minimum: 1

Maximum: 56

uid

No

String

Node ID, which is unique and automatically generated after the resource is created. A user-defined ID will not take effect.

labels

No

Map<String,String>

CCE node label (not the native Kubernetes label).

Labels are used to select objects that meet certain criteria. A label is a key-value pair.

Example:

"labels": {
"key" : "value"
}

annotations

No

Map<String,String>

CCE node annotations in key-value pairs (not the native Kubernetes annotations).

Example:

"annotations": {
"key1" : "value1",
"key2" : "value2"
}
NOTE:

annotations is not used to identify or select objects. Metadata in annotations can be small or large, structured or unstructured, and can include characters that are not allowed in labels.

creationTimestamp

No

String

Time when the object was created. The value is automatically generated after the object is created. A user-defined value will not take effect.

updateTimestamp

No

String

Time when the object was updated. The value is automatically generated after the object is created. A user-defined value will not take effect.

Table 6 V3NodeSpec

Parameter

Mandatory

Type

Description

flavor

Yes

String

Node specifications.

Minimum: 1

Maximum: 50

az

Yes

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

No

String

Node OS.

  • For a VM node, the value can be EulerOS, CentOS, Debian, or Ubuntu. The default value is EulerOS.
NOTE:

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

  • For monthly/yearly-billed BMS nodes with auto payment enabled, only EulerOS 2.3, EulerOS 2.5, and EulerOS 2.8 are supported.
  • If the alpha.cce/NodeImageID parameter in extendParam is specified during node creation, you do not need to set this field.

login

Yes

Login object

Node login mode.

rootVolume

Yes

V3RootVolume object

System disk information of the node.

dataVolumes

Yes

Array of V3DataVolume objects

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

For DeC nodes, the parameter description is the same as that for rootVolume.

publicIP

No

V3NodePublicIP object

EIP of the node.

nodeNicSpec

No

NodeNicSpec object

NIC information of the node.

count

Yes

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

No

Integer

Billing mode of a node. The value can be 0 (pay-per-use) or 2 (yearly/monthly).

Tokens of common users can be used to create yearly/monthly-billed nodes with auto payment enabled.

NOTE:

Creating pay-per-use nodes does not affect the cluster status. When you create a yearly/monthly-billed node, the cluster status changes to Scaling out.

taints

No

Array of Taint objects

You can add taints to created nodes to set affinity. Each taint contains the following three parameters: \n\n- 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. \n- 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 (.). \n- Effect: Available options are NoSchedule, PreferNoSchedule, and NoExecute. \n\nExample: \n\n\n"taints": [{\n\t"key": "status",\n\t"value": "unavailable",\n\t"effect": "NoSchedule"\n}, {\n\t"key": "looks",\n\t"value": "bad",\n\t"effect": "NoSchedule"\n}]\n

k8sTags

No

Map<String,String>

The format is a key-value pair. The number of key-value pairs cannot exceed 20. \n\n- 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 \n- 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. \n\nExample: \n\n\n"k8sTags": {\n\t"key": "value"\n}\n

ecsGroupId

No

String

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

dedicatedHostId

No

String

ID of the DeH to which the node is scheduled. \n>This field is not supported when you add a node during node pool creation.

offloadNode

No

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

No

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

No

Map<String,Object>

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

  • chargingMode: node billing mode. Value 0 indicates pay-per-use. If this field is left unspecified, the default value 0 is used.
  • ecs:performancetype: ECS flavor. This field does not exist for a BMS node.
  • orderID: order ID. This field is returned in the response when the node is yearly/monthly-billed with auto payment enabled.
  • 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.
  • periodType: subscription period unit. Options:
  • month: The unit is month.
  • year: The unit is year.
NOTE:

This field is valid and mandatory when billingMode is set to 2 (yearly/monthly-billed with auto payment enabled).

  • periodNum: subscription period. Options:
  • If periodType is month, the value ranges from 1 to 9.
  • If periodType is year, the value is 1.
NOTE:

This field is valid and mandatory when billingMode is set to 2.

  • isAutoRenew: whether auto renew is enabled.
  • true: Auto renewal is enabled.
  • false: Auto renewal is not enabled.
NOTE:

This field is valid and mandatory when billingMode is set to 2.

  • isAutoPay: 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 2. If this field is not specified, fees are automatically deducted by default.

  • DockerLVMConfigOverride: Docker data disk configurations. 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 CentOS 7.6 or 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
  • 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.
Table 7 Login

Parameter

Mandatory

Type

Description

sshKey

No

String

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

userPassword

No

UserPassword object

Password used for node login. Either the key pair or password must be used for login.

Table 8 UserPassword

Parameter

Mandatory

Type

Description

username

No

String

Login account. The default value is root.

Default: root

password

Yes

String

Login password. For details, see the description of the adminPass parameter in Creating an ECS. If a username and password are used to create a node, this field is shielded in the response body. Add a salt to the password field when creating a node. For details, see Adding a Salt in the password Field When Creating a Node.

Table 9 V3RootVolume

Parameter

Mandatory

Type

Description

size

Yes

Integer

Disk size in the unit of GB.

  • System disk: 40 to 1024
  • Data disk: 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 in the ECS API reference.

  • SATA: common I/O disk
  • SAS: high I/O disk
  • SSD: ultra-high I/O disk

extendParam

No

Map<String,Object>

Disk extension parameter. For details, see the description of the extendparam parameter in 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, ID of the DSS storage pool.

To obtain the value, see the ID field in "Table 3 Response parameters" in Obtaining Details of a DSS Storage Pool.

cluster_type

No

String

Storage class of the ECS 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, the created disk is of the SCSI type.
  • If the node pool type is ElasticBMS, this field must be set to true.
Table 10 V3DataVolume

Parameter

Mandatory

Type

Description

size

Yes

Integer

Disk size in the unit of GB.

  • System disk: 40 to 1024
  • Data disk: 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 in the ECS API reference.

  • SATA: common I/O disk
  • SAS: high I/O disk
  • SSD: ultra-high I/O disk

extendParam

No

Map<String,Object>

Disk extension parameter. For details, see the description of the extendparam parameter in 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, ID of the DSS storage pool.

To obtain the value, see the ID field in "Table 3 Response parameters" in Obtaining Details of a DSS Storage Pool.

cluster_type

No

String

Storage class of the ECS 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, the created disk is of the SCSI type.
  • If the node pool type is ElasticBMS, this field must be set to true.

metadata

No

DataVolumeMetadata object

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

Table 11 DataVolumeMetadata

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 field does not exist, the disk 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 12 V3NodePublicIP

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

count

No

Integer

Number of EIPs to be dynamically created.

NOTE:

The count and eip parameters must be set together.

eip

No

V3NodeEIPSpec object

EIP configuration.

Table 13 V3NodeEIPSpec

Parameter

Mandatory

Type

Description

iptype

No

String

EIP type. For details, see the description of the iptype field in the eip parameter description in Data Structure for Creating ECSs.

bandwidth

No

V3NodeBandwidth object

Bandwidth parameters of the EIP.

Table 14 V3NodeBandwidth

Parameter

Mandatory

Type

Description

chargemode

No

String

2- 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 transmission rate (in Mbps) of public networks. This billing mode is recommended if your bandwidth usage is higher than 10%.
NOTE:
  • Billed by traffic: The billing is based on the total amount of data (unit: 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

String

Bandwidth size. For details, see the description of the size field in the bandwidth parameter description in Data Structure for Creating ECSs.

sharetype

No

String

Bandwidth sharing type. For details, see the description of the sharetype field in the bandwidth parameter description in Data Structure for Creating ECSs.

Table 15 NodeNicSpec

Parameter

Mandatory

Type

Description

primaryNic

No

NicSpec object

Description of the primary NIC.

extNics

No

Array of NicSpec objects

Extension NIC.

Table 16 NicSpec

Parameter

Mandatory

Type

Description

subnetId

No

String

ID of the subnet to which the NIC belongs.

fixedIps

No

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

No

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

Parameter

Mandatory

Type

Description

key

No

String

Key.

value

No

String

Value.

Maximum: 63

effect

No

String

Effect.

Enumeration values:

  • NoSchedule
  • PreferNoSchedule
  • NoExecute
Table 18 UserTag

Parameter

Mandatory

Type

Description

key

No

String

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

Minimum: 1

Maximum: 36

value

No

String

Value of the cloud server label.

Minimum: 0

Maximum: 43

Response Parameters

Status code: 201

Table 19 Response body parameters

Parameter

Type

Description

kind

String

API type. The value is fixed at Node and cannot be changed.

Default: Node

apiVersion

String

API version. The value is fixed at v3 and cannot be changed.

Default: v3

metadata

NodeMetadata object

Node metadata, which is a collection of attributes.

spec

V3NodeSpec object

Detailed description of the node object. CCE creates or updates objects by defining or updating spec.

status

V3NodeStatus object

Node status, which is dynamically recorded. A user-defined value will not function when a node is being created or modified.

Table 20 NodeMetadata

Parameter

Type

Description

name

String

Node name.

NOTE:

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

Minimum: 1

Maximum: 56

uid

String

Node ID, which is unique and automatically generated after the resource is created. A user-defined ID will not take effect.

labels

Map<String,String>

CCE node label (not the native Kubernetes label).

Labels are used to select objects that meet certain criteria. A label is a key-value pair.

Example:

"labels": {
"key" : "value"
}

annotations

Map<String,String>

CCE node annotations in key-value pairs (not the native Kubernetes annotations).

Example:

"annotations": {
"key1" : "value1",
"key2" : "value2"
}
NOTE:

annotations is not used to identify or select objects. Metadata in annotations can be small or large, structured or unstructured, and can include characters that are not allowed in labels.

creationTimestamp

String

Time when the object was created. The value is automatically generated after the object is created. A user-defined value will not take effect.

updateTimestamp

String

Time when the object was updated. The value is automatically generated after the object is created. A user-defined value will not take effect.

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

  • For a VM node, the value can be EulerOS, CentOS, Debian, or Ubuntu. The default value is EulerOS.
NOTE:

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

  • For monthly/yearly-billed BMS nodes with auto payment enabled, only EulerOS 2.3, EulerOS 2.5, and EulerOS 2.8 are supported.
  • If the alpha.cce/NodeImageID parameter in extendParam is specified during node creation, you do not need to set this field.

login

Login object

Node login mode.

rootVolume

V3RootVolume object

System disk information of the node.

dataVolumes

Array of V3DataVolume objects

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

For DeC nodes, the parameter description is the same as that for rootVolume.

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. The value can be 0 (pay-per-use) or 2 (yearly/monthly).

Tokens of common users can be used to create yearly/monthly-billed nodes with auto payment enabled.

NOTE:

Creating pay-per-use nodes does not affect the cluster status. When you create a yearly/monthly-billed node, the cluster status changes to Scaling out.

taints

Array of Taint objects

You can add taints to created nodes to set affinity. Each taint contains the following three parameters: \n\n- 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. \n- 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 (.). \n- Effect: Available options are NoSchedule, PreferNoSchedule, and NoExecute. \n\nExample: \n\n\n"taints": [{\n\t"key": "status",\n\t"value": "unavailable",\n\t"effect": "NoSchedule"\n}, {\n\t"key": "looks",\n\t"value": "bad",\n\t"effect": "NoSchedule"\n}]\n

k8sTags

Map<String,String>

The format is a key-value pair. The number of key-value pairs cannot exceed 20. \n\n- 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 \n- 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. \n\nExample: \n\n\n"k8sTags": {\n\t"key": "value"\n}\n

ecsGroupId

String

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

dedicatedHostId

String

ID of the DeH to which the node is scheduled. \n>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:

  • chargingMode: node billing mode. Value 0 indicates pay-per-use. If this field is left unspecified, the default value 0 is used.
  • ecs:performancetype: ECS flavor. This field does not exist for a BMS node.
  • orderID: order ID. This field is returned in the response when the node is yearly/monthly-billed with auto payment enabled.
  • 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.
  • periodType: subscription period unit. Options:
  • month: The unit is month.
  • year: The unit is year.
NOTE:

This field is valid and mandatory when billingMode is set to 2 (yearly/monthly-billed with auto payment enabled).

  • periodNum: subscription period. Options:
  • If periodType is month, the value ranges from 1 to 9.
  • If periodType is year, the value is 1.
NOTE:

This field is valid and mandatory when billingMode is set to 2.

  • isAutoRenew: whether auto renew is enabled.
  • true: Auto renewal is enabled.
  • false: Auto renewal is not enabled.
NOTE:

This field is valid and mandatory when billingMode is set to 2.

  • isAutoPay: 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 2. If this field is not specified, fees are automatically deducted by default.

  • DockerLVMConfigOverride: Docker data disk configurations. 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 CentOS 7.6 or 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
  • 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.
Table 22 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.

userPassword

UserPassword object

Password used for node login. Either the key pair or password must be used for login.

Table 23 UserPassword

Parameter

Type

Description

username

String

Login account. The default value is root.

Default: root

password

String

Login password. For details, see the description of the adminPass parameter in Creating an ECS. If a username and password are used to create a node, this field is shielded in the response body. Add a salt to the password field when creating a node. For details, see Adding a Salt in the password Field When Creating a Node.

Table 24 V3RootVolume

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 disk
  • SAS: high I/O disk
  • SSD: ultra-high I/O disk

extendParam

Map<String,Object>

Disk extension parameter. For details, see the description of the extendparam parameter in 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, ID of the DSS storage pool.

To obtain the value, see the ID field in "Table 3 Response parameters" in Obtaining Details of a DSS Storage Pool.

cluster_type

String

Storage class of the ECS 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, the created disk is of the SCSI type.
  • If the node pool type is ElasticBMS, this field must be set to true.
Table 25 V3DataVolume

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 disk
  • SAS: high I/O disk
  • SSD: ultra-high I/O disk

extendParam

Map<String,Object>

Disk extension parameter. For details, see the description of the extendparam parameter in 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, ID of the DSS storage pool.

To obtain the value, see the ID field in "Table 3 Response parameters" in Obtaining Details of a DSS Storage Pool.

cluster_type

String

Storage class of the ECS 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, 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 field is mandatory only when the data disk of the node to be created needs to be encrypted.

Table 26 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 27 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 28 V3NodeEIPSpec

Parameter

Type

Description

iptype

String

EIP type. For details, see the description of the iptype field in the eip parameter description in Data Structure for Creating ECSs.

bandwidth

V3NodeBandwidth object

Bandwidth parameters of the EIP.

Table 29 V3NodeBandwidth

Parameter

Type

Description

chargemode

String

2- 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 transmission rate (in Mbps) of public networks. This billing mode is recommended if your bandwidth usage is higher than 10%.
NOTE:
  • Billed by traffic: The billing is based on the total amount of data (unit: 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

String

Bandwidth size. For details, see the description of the size field in the bandwidth parameter description in Data Structure for Creating ECSs.

sharetype

String

Bandwidth sharing type. For details, see the description of the sharetype field in the bandwidth parameter description in Data Structure for Creating ECSs.

Table 30 NodeNicSpec

Parameter

Type

Description

primaryNic

NicSpec object

Description of the primary NIC.

extNics

Array of NicSpec objects

Extension NIC.

Table 31 NicSpec

Parameter

Type

Description

subnetId

String

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 32 Taint

Parameter

Type

Description

key

String

Key.

value

String

Value.

Maximum: 63

effect

String

Effect.

Enumeration values:

  • NoSchedule
  • PreferNoSchedule
  • NoExecute
Table 33 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 34 V3NodeStatus

Parameter

Type

Description

phase

String

Node status.

Enumeration values:

  • Build
  • Installing
  • Installed
  • ShutDown
  • Upgrading
  • Active
  • Abnormal
  • Deleting
  • Error

jobID

String

ID of a creation or deletion job.

serverId

String

ID of the underlying ECS or BMS node.

privateIP

String

IP address in the private network segment of the primary NIC on the node.

publicIP

String

Node EIP. If the ECS data is not synchronized in real time, you can click Sync Node Data on the console to manually update the data.

deleteStatus

DeleteStatus object

Resource status during resource deletion.

Table 35 DeleteStatus

Parameter

Type

Description

previous_total

Integer

Total number of existing cluster resource records when the cluster is deleted.

current_total

Integer

Latest number of resource records, which is generated based on the current cluster resource records.

updated

Integer

Total number of resource records updated when the cluster is deleted.

added

Integer

Total number of resource records updated when the cluster is deleted.

deleted

Integer

Total number of resource records deleted when the cluster is deleted.

Example Requests

  • Creating a yearly/monthly-billed node
    POST /api/v3/projects/{project_id}/clusters/{cluster_id}/nodes
    
    {
      "kind" : "Node",
      "apiVersion" : "v3",
      "metadata" : {
        "name" : "test-create-period-node"
      },
      "spec" : {
        "flavor" : "s3.large.2",
        "az" : "cn-south-2b",
        "os" : "EulerOS 2.5",
        "login" : {
          "userPassword" : {
            "username" : "root",
            "password" : "encryptedPassword"
          }
        },
        "rootVolume" : {
          "size" : 40,
          "volumetype" : "SAS"
        },
        "dataVolumes" : [ {
          "size" : 100,
          "volumetype" : "SAS"
        } ],
        "publicIP" : {
          "count" : 1,
          "eip" : {
            "iptype" : "5_bgp",
            "bandwidth" : {
              "chargemode" : "",
              "size" : 5,
              "sharetype" : "PER"
            }
          }
        },
        "billingMode" : 2,
        "count" : 1,
        "extendParam" : {
          "periodType" : "month",
          "periodNum" : 1,
          "isAutoRenew" : "true",
          "isAutoPay" : "true",
          "alpha.cce/postInstall" : "",
          "DockerLVMConfigOverride" : "dockerThinpool=vgpaas/90%VG;kubernetesLV=vgpaas/10%VG;diskType=evs;lvType=linear"
        },
        "nodeNicSpec" : {
          "primaryNic" : {
            "subnetId" : "634138f2-febf-4a99-8208-42fceba42041"
          }
        }
      }
    }
  • Creating a pay-per-use node
    POST /api/v3/projects/{project_id}/clusters/{cluster_id}/nodes
    
    {
      "kind" : "Node",
      "apiVersion" : "v3",
      "metadata" : {
        "name" : "test-create-ondemand-node"
      },
      "spec" : {
        "flavor" : "s3.large.2",
        "az" : "cn-south-2b",
        "os" : "EulerOS 2.5",
        "login" : {
          "userPassword" : {
            "username" : "root",
            "password" : "encryptedPassword"
          }
        },
        "rootVolume" : {
          "size" : 40,
          "volumetype" : "SAS"
        },
        "dataVolumes" : [ {
          "size" : 100,
          "volumetype" : "SAS"
        } ],
        "publicIP" : {
          "count" : 1,
          "eip" : {
            "iptype" : "5_bgp",
            "bandwidth" : {
              "chargemode" : "",
              "size" : 5,
              "sharetype" : "PER"
            }
          }
        },
        "billingMode" : 0,
        "count" : 1,
        "extendParam" : {
          "DockerLVMConfigOverride" : "dockerThinpool=vgpaas/90%VG;kubernetesLV=vgpaas/10%VG;diskType=evs;lvType=linear"
        },
        "nodeNicSpec" : {
          "primaryNic" : {
            "subnetId" : "634138f2-febf-4a99-8208-42fceba42041"
          }
        }
      }
    }

Example Responses

Status code: 201

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

{
  "kind" : "Node",
  "apiVersion" : "v3",
  "metadata" : {
    "name" : "myhost",
    "labels" : {
      "foo" : "bar"
    },
    "annotations" : {
      "annotation1" : "abc"
    }
  },
  "spec" : {
    "flavor" : "s1.medium",
    "az" : "az1.dc1",
    "os" : "EulerOS 2.2",
    "login" : {
      "sshKey" : "myKeypair",
      "userPassword" : { }
    },
    "rootVolume" : {
      "volumetype" : "SATA",
      "size" : 40
    },
    "dataVolumes" : [ {
      "volumetype" : "SATA",
      "size" : 100
    } ],
    "publicIP" : {
      "count" : 2,
      "eip" : {
        "iptype" : "5_bgp",
        "bandwidth" : {
          "size" : 10,
          "sharetype" : "PER",
          "chargemode" : "traffic"
        }
      }
    },
    "count" : 2,
    "billingMode" : 0,
    "extendParam" : {
      "chargingMode" : 0,
      "ecs:performancetype" : "normal",
      "orderID" : "",
      "productID" : ""
    }
  },
  "status" : {
    "jobID" : "2ec9b78d-9368-46f3-8f29-d1a95622a568"
  }
}

Status Codes

Status Code

Description

201

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

Error Codes

See Error Codes.