• Cloud Container Engine

cce
  1. Help Center
  2. Cloud Container Engine
  3. API Reference
  4. Cluster and Host Management (Proprietary APIs)
  5. Adding a Node to a Container Cluster

Adding a Node to a Container Cluster

Function

This API is used to add a node to a container cluster. A maximum of 15 nodes are allowed in a single container cluster.

URI

POST /api/v1/clusters/{clusteruuid}/hosts

Table 1 describes the parameter of this API.

Table 1 Parameter description

Parameter

Mandatory

Description

clusteruuid

Yes

UUID of the container cluster.

Request

Request parameter:

Table 2 describes the request parameters.

Table 2 Request parameters

Parameter

Mandatory

Type

Description

kind

Yes

String

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated.

apiVersion

Yes

String

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values.

spec

Yes

Table 3

-

replicas

Yes

Integer

Number of node instances to be added.

A maximum of 15 nodes are allowed in a single container cluster.

Table 3 Data structure of the spec field

Parameter

Mandatory

Type

Description

flavor

Yes

String

Specifications of the node to be added. Table 5 describes the Data structure of the flavor field.

label

No

String

Label attached to the node.

volume

Yes

Table 4

Disk information.

sshkey

Yes

String

SSH key used to create the node.

snat

No

Boolean

Whether the SNAT function is supported.

Options: true and false.

NOTE:

If this parameter is set to true:

  • Bind an EIP to the node so that CCE can access external networks. For detailed operations, see Help Center > Virtual Private Cloud > User Guide > Network Components > EIP > Assigning an EIP and Binding It to an ECS.
  • Set a node in this cluster or create a new ECS (in the same VPC as the cluster) as the SNAT server and bind an EIP to the SNAT server. The SNAT server shares this EIP with other nodes. In this way, CCE can access external networks. For detailed operations, see Help Center > Virtual Private Cloud > User Guide > Network Components > Custom Route > Configuring a SNAT Server.

az

No

String

Name of the AZ where the node to be added resides.

NOTE:

If this parameter is left unspecified, the system selects an AZ automatically when adding the node. After the node is successfully added, the node's AZ will be displayed on the node details page on the CCE console.

tags

No

String Array

Specifies the tags of a Node.

A tag is in format of "key.value", where the maximum lengths of key and value are 36 and 43 characters, respectively.

When adding a tag to a Node, ensure that the tag complies with the following requirements:

  • The tag key can consist of only uppercase letters, lowercase letters, numerals, special characters (-_), and Unicode characters.
  • The tag value can consist of only uppercase letters, lowercase letters, numerals, special characters (.-_), and Unicode characters.
    NOTE:
    • When you add a Node, one Node supports up to 10 tags.
    • Key-value pairs used to identify node resource (ECS, EVS, and EIP) attributes. You can view these tags on ECS, EVS, and EIP consoles.
Table 4 Data structure of the volume field

Parameter

Mandatory

Type

Description

diskType

Yes

String

Disk type, which is used to determine a data disk or a system disk.

  • root: system disk.
  • data: data disk.

diskSize

Yes

Integer

Disk size.

  • Capacity of the system disk is hard-coded to be 40 GB.
  • Capacity of the data disk is user configurable and ranges from 100 GB to 32768 GB (inclusive).

volumeType

Yes

String

Disk IO type.

  • SATA: indicates SATA disks.
  • SAS: indicates SAS disks.
  • SSD: indicates SSD disks.
Table 5 Data structure of the flavor field

ECS Type

Flavor

Number of vCPUs

Memory Size (GB)

General Purpose

s1.medium

1

4

s1.large

2

8

s1.xlarge

4

16

s1.2xlarge

8

32

s1.4xlarge

16

64

s1.8xlarge

32

128

Compute I

c1.large

2

2

c1.xlarge

4

4

c1.2xlarge

8

8

c1.4xlarge

16

16

c1.8xlarge

32

32

Compute II

c2.medium

1

2

c2.large

2

4

c2.xlarge

4

8

c2.2xlarge

8

16

c2.4xlarge

16

32

c2.8xlarge

32

64

Memory Optimized

m1.medium

1

8

m1.large

2

16

m1.xlarge

4

32

m1.2xlarge

8

64

m1.4xlarge

16

128

m2.8xlarge.8

32

256

Example request:

{
    "kind": "host",
    "apiVersion": "v1",
    "spec": {
        "flavor": "s1.medium",
        "label": "",
        "volume": [
            {
                "diskType": "root",
                "diskSize": 40,
                "volumeType": "SAS"
            },
            {
                "diskType": "data",
                "diskSize": 100,
                "volumeType": "SATA"
            }
        ],
        "sshkey": "SSHkey-1864",
        "snat": false,
        "az": "eu-de-01",
        "tags": ["aaa.111", "bbb.222"]
    },
    "replicas": 1
}

Response

N/A

Status Code

Table 6 describes the status code of this API.

Table 6 Status code

Status Code

Description

201

The request for adding a node is sent successfully.

NOTE:

The clusterStatus parameter in the response to the GET /api/v1/clusters/{clusteruuid} request (see Obtaining Information About a Specified Cluster) indicates whether the node has been successfully created.

  • If the value of the clusterStatus parameter is SCALING, the node is being created.
  • If the value of the clusterStatus parameter is AVAILABLE, the node has been successfully created.

It takes about 20 to 30 minutes to create a node.

For the description about status codes, see section Status Codes.