You can call ScaleOutCluster to describe how to add worker nodes to a Kubernetes cluster that supports sandboxed-containers. The cluster can be deployed across multiple zones.

Request information

Request line

POST /api/v2/clusters/{cluster_id} HTTP/1.1
Table 1. Request parameters
Parameter Type Required Description
cluster_id string Yes The ID of the cluster.

Custom request headers

None. For more information, see Public request headers.

Request body

{
    "login_password": "logon password. Select one between password authentication and key pair authentication",
    "worker_instance_charge_type": "PostPaid",
    "worker_vswitch_ids": "VSwitch IDs. Specify one to three VSwitches",
    "worker_instance_types": "instance type of worker nodes",
    "worker_system_disk_category": "system disk type of worker nodes",
    "worker_system_disk_size": "system disk size of worker nodes",
    "worker_data_disk": "whether to mount data disks. true|false",
    "worker_data_disk_category": "data disk type of worker nodes",
    "worker_data_disk_size": "data disk size of worker nodes",
    "tags": "an array of labels",
    "count": "number of worker nodes to be added"
}
Table 2. Request body parameters
Parameter Type Required Description
count int Yes The number of worker nodes to be added to the cluster.
login_password string Yes The passwords of the worker nodes to be added. The password must be 8 to 30 characters in length and contain three of the following four types of characters: uppercase letters, lowercase letters, digits, and special characters. Select one between login_password and key_pair.
key_pair string Yes The keypair name. Select one between login_password and key_pair.
vswitch_ids list Yes The VSwitch IDs of the worker nodes.
worker_data_disk bool Yes Whether to mount data disk to worker nodes.
  • A value of true indicates yes.
  • A value of false indicates no.
To enable sandboxed-containers, you must set the value to true.
worker_data_disk_size string Yes The data disk size in GiB. To enable sandboxed-containers, you must mount a data disk of 200 GiB at least.
worker_instance_types list Yes The type of instance that supports sandboxed-containers. Valid values:
  • ecs.ebmg5s.24xlarge
  • ecs.ebmc5s.24xlarge
  • ecs.ebmgn6i.24xlarge
worker_data_disk_category string No The data disk type of worker nodes.
worker_system_disk_category string No The system disk type of worker nodes.
worker_system_disk_size int No The system disk size of worker nodes. Unit: GiB.

Return information

Response line

HTTP/1.1 202 Accepted

Custom response headers

None. For more information, see Public response headers.

Response body

{
    "cluster_id":"string",
    "request_id":"string",
    "task_id":"string"
}

Example

Sample request

POST /api/v2/clusters/Cccfd68c474454665ace07efce924**** HTTP/1.1
<Common request headers>
{
    "login_password":"xxxxxxxx",
    "worker_instance_charge_type":"PostPaid",
    "vswitch_ids":["vsw-2zes3rfz7bmk0nxxxxxxx"],
    "worker_instance_types":["ecs.ebmg5s.24xlarge"],
    "worker_system_disk_category":"cloud_efficiency",
    "worker_system_disk_size":120,
    "worker_data_disk":true,
    "worker_data_disk_category":"cloud_efficiency",
    "worker_data_disk_size":200,
    "tags":[],
    "count":1,
    "disable_rollback":false
}

Sample response

HTTP/1.1 202 Accepted
<Common response headers>
{
    "cluster_id": "Cccfd68c474454665ace07efce924****",
    "request_id": "687C5BAA-D103-4993-884B-C35E4314A1E1",
    "task_id": "T-5a54309c80282e39ea00002f"
}