Accepting a Node
Function
This API is used to accept a node into a specified cluster.
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
ECSs, DeHs, and BMSs can be managed.
URI
POST /api/v3/projects/{project_id}/clusters/{cluster_id}/nodes/add
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
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. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
apiVersion |
Yes |
String |
API version. The value is fixed at v3. |
kind |
Yes |
String |
API type. The value is fixed at List. |
nodeList |
Yes |
Array of AddNode objects |
List of nodes to be managed. A maximum of 200 nodes can be managed simultaneously. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
serverID |
Yes |
String |
Server ID, which can be obtained from the ECS or BMS console |
spec |
Yes |
ReinstallNodeSpec object |
Node reinstallation configuration parameters. Currently, accepted nodes cannot be added into node pools. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
os |
Yes |
String |
OS. If you specify a custom image, the actual OS version of the IMS image is used. Select an OS version supported by the current cluster. |
login |
Yes |
Login object |
Node login mode. Either the key pair or password must be used for login. This parameter cannot be modified when a node pool is being updated. |
name |
No |
String |
Node name. Specifying this field during reinstallation will change the node name, and the server name will change accordingly. By default, the current server name is used as the node name. Enter 1 to 56 characters starting with a lowercase letter. Only lowercase letters, digits, hyphens (-), and periods (.) are allowed. |
serverConfig |
No |
ReinstallServerConfig object |
Server configuration. |
volumeConfig |
No |
ReinstallVolumeConfig object |
Volume management configuration. |
runtimeConfig |
No |
ReinstallRuntimeConfig object |
Container runtime configuration. |
k8sOptions |
No |
ReinstallK8sOptionsConfig object |
Kubernetes node configuration. |
lifecycle |
No |
NodeLifecycleConfig object |
Customized lifecycle configuration of a node. |
initializedConditions |
No |
Array of strings |
Custom initialization flag. Before CCE nodes are initialized, they are tainted with node.cloudprovider.kubernetes.io/uninitialized to prevent pods from being scheduled to them. CCE supports custom initialization flags. After receiving the initializedConditions parameter, CCE converts the parameter value into a node label and provisions the label with the node, for example, cloudprovider.openvessel.io/inject-initialized-conditions=CCEInitial_CustomedInitial. After the node is labeled, its status.Conditions is polled to check whether the type of conditions has a flag name, such as CCEInitial and CustomedInitial. If all input flags exist and their status is True, the node initialization is complete and the initialization taint is removed.
|
extendParam |
No |
ReinstallExtendParam object |
Extended reinstallation parameter, which is discarded. |
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. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
sshKey |
No |
String |
Name of the key pair used for login. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
username |
No |
String |
Login account. The default value is root. |
password |
Yes |
String |
Login password. If a username and password are used to create a node, this field is shielded in the response body. A password must meet the following complexity requirements:
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
userTags |
No |
Array of UserTag objects |
Cloud server tag (resource tag). The key of a tag must be unique. The maximum number of custom tags supported by CCE varies depending on regions and cannot exceed 8. |
rootVolume |
No |
ReinstallVolumeSpec object |
System disk configurations used in reinstallation. |
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. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
imageID |
No |
String |
Custom image ID. |
cmkID |
No |
String |
User master key ID. If this parameter is left blank by default, the EVS disk is not encrypted. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
lvmConfig |
No |
String |
Configuration item of a Docker data disk (deprecated). The following is an example of the default configuration: "lvmConfig":"dockerThinpool=vgpaas/90%VG;kubernetesLV=vgpaas/10%VG;diskType=evs;lvType=linear" The following fields are included:
|
storage |
No |
Storage object |
Disk initialization management parameter. This parameter is complex to configure. For details, see Attaching Disks to a Node.
|
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. |
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 |
Storage type. Only evs (EVS disks) and local (local disks) are supported. The local storage does not support disk selection. All local disks will form a VG, so only one storageSelector of the local type is allowed. |
matchLabels |
No |
matchLabels object |
Matching field of an EVS disk. The value can be size, volumeType, metadataEncrypted, metadataCmkid, or count in DataVolume. |
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. If this parameter is left blank, there is no restriction on the disk type. |
metadataEncrypted |
No |
String |
Disk encryption identifier. If this parameter is set to 0, it specifies that the disk is not encrypted. If this parameter is set to 1, it specifies that the disk is encrypted. If this parameter is left blank, there is no restriction on the disk encryption identifier. |
metadataCmkid |
No |
String |
CMK ID of an encrypted disk. The value is a string of 36 bytes. If this parameter is left blank, there is no restriction on the disk key ID. |
count |
No |
String |
Number of disks to be selected. If this parameter is left blank, all disks of this type are selected. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
Yes |
String |
Name of a virtual storage group, which must be unique.
|
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 |
Corresponds to name in storageSelectors. One group can select multiple selectors, but one selector can be selected by only one group. |
virtualSpaces |
Yes |
Array of VirtualSpace objects |
Detailed management of space configuration in a group. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
Yes |
String |
Name of a virtualSpace. Options: share, kubernetes, runtime, and user
|
size |
Yes |
String |
Size of a virtualSpace. The value must be an integer in percentage. Example: 90%. The value ranges from 10 to 90. The sum of percentages of all virtualSpaces in a group cannot exceed 100%. |
lvmConfig |
No |
LVMConfig object |
LVM configuration managements, applicable to the share*, 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. |
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 |
Disk mount path. This parameter takes effect only in user configuration. The value is an absolute path. Digits, letters, periods (.), hyphens (-), and underscores (_) are allowed. Do not leave the path empty or set it to a key OS path such as the root directory. Key OS paths that cannot be specified: /, /home, /home/, /bin, /bin/, /lib, /lib/, /root, /root/, /boot, /boot/, /dev, /dev/, /etc, /etc/, /lost+found, /lost+found/, /mnt, /mnt/, /proc, /proc/,/sbin, /sbin/, /srv, /srv/, /tmp, /tmp/, /var, /var/, /media, /media/, /opt, /opt/, /selinux, /selinux/, /sys, /sys/, /usr, /usr/, /opt/cloud/, /mnt/paas/, /home/paas/, /var/paas/, /var/lib/, /var/script/ |
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. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
dockerBaseSize |
No |
Integer |
Available disk space of a single container on a node, in GB. This parameter has been discarded. Use containerBaseSize. 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 nodes running EulerOS in clusters of the new versions. For details about how to allocate the space for the container runtime, see Data Disk Space Allocation. When Device Mapper is used, it is recommended that dockerBaseSize be set 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. |
containerBaseSize |
No |
Integer |
Available disk space of a single container on a node, in GiB. If this parameter is left blank or is set to 0, the default value is used. In OverlayFS mode, the available space of a single container is not limited by default. In Device Mapper mode, the default value is 10, and the containerBaseSize setting takes effect only on nodes running EulerOS in clusters v1.23.14-r0, v1.25.9-r0, v1.27.6-r0, v1.28.4-r0 or later. For details about how to allocate the space for the container runtime, see Data Disk Space Allocation. When Device Mapper is used, it is recommended that containerBaseSize be set 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. In new versions, the Device Mapper mode is used only by BMSs in the same resource pool and is being discarded. This parameter cannot be updated when a node pool is being updated. |
runtime |
No |
Runtime object |
Container runtime. Default value:
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
No |
String |
Container runtime. Default value:
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
labels |
No |
Map<String,String> |
Defined in key-value pairs. A maximum of 20 key-value pairs are allowed.
Example: "k8sTags": { "key": "value" } |
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:
Example: "taints": [{ "key": "status", "value": "unavailable", "effect": "NoSchedule" }, { "key": "looks", "value": "bad", "effect": "NoSchedule" }] |
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. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
key |
Yes |
String |
Key. |
value |
No |
String |
Value. |
effect |
Yes |
String |
Effect. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
preInstall |
No |
String |
Pre-installation scripts. The total number of characters after transcoding cannot exceed 10240. The input value must be encoded using Base64. The method is as follows: echo -n "Content to be encoded" | base64 |
postInstall |
No |
String |
Post-installation scripts. The total number of characters after transcoding cannot exceed 10240. The input value must be encoded using Base64. The method is as follows: echo -n "Content to be encoded" | base64 |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
alpha.cce/NodeImageID |
No |
String |
(Discarded) ID of the user image to run the target OS. Specifying this parameter is equivalent to specifying imageID in ReinstallVolumeSpec. The original value will be overwritten. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
type |
Yes |
String |
Configuration type of the Kubernetes node name. The default value is privateIp.
|
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
jobid |
String |
Job ID returned after the job is delivered. The job ID can be used to query the job execution status. |
Example Requests
Add a node running EulerOS 2.5 to a cluster.
POST /api/v3/projects/{project_id}/clusters/{cluster_id}/nodes/add { "kind" : "List", "apiVersion" : "v3", "nodeList" : [ { "serverID" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "spec" : { "name" : "my-ecs-0001", "os" : "EulerOS 2.5", "login" : { "sshKey" : "KeyPair-001" } } } ] }
Example Responses
Status code: 200
The job for accepting a node into a specified cluster is successfully delivered.
{ "jobid" : "2ec9b78d-9368-46f3-8f29-d1a95622a568" }
Status Codes
Status Code |
Description |
---|---|
200 |
The job for accepting a node into a specified cluster is successfully delivered. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.