Increase the number of nodes in the cluster. For more information about the API description, see Container Service API reference.

Scope

Swarm clusters and Kubernetes clusters.

API request and response

Request format

aliyun cs  PUT /clusters/<cluster_id> --header "Content-Type=application/json" --body "$(cat scale.json)"

Parameter descriptions:

  • --header Specify Content-Type as application/json.
  • --body is the body to be sent to the server, which can be read from a local file and must be in the valid JSON format. The scale.json contents are as follows:

Swarm clusters

{
        "password": "password used to log on to the Elastic Compute Service (ECS) instance by using SSH",
        "instance_type": "ECS instance type",
        "size": "number of nodes after expansion",
        "data_disk_category": "disk category",
        "data_disk_size": "disk size",
        "io_optimized": "whether or not to be I/O optimized, which is yes by default in the VPC environment",
        "ecs_image_id": "image ID",
        "release_eip_flag": "whether or not to release Elastic IP (EIP) after configuring the cluster"
}
Kubernetes clusters
{ "disable_rollback": "whether or not to roll back if the cluster fails to be scaled out or in",
"timeout_mins": "timeout for creating the cluster",

"worker_instance_type": "instance type of worker nodes",
"login_password": "password used to log on to the node by using SSH", 
"num_of_nodes": "number of worker nodes"
}

Response results

{
    "cluster_id": "c61cf530524474386a7ab5a1c192a0d57",
    "request_id": "348D4C9C-9105-4A1B-A86E-B58F0F875575",
    "task_id": "T-5ad724ab94a2b109e8000004"
}