Skip to main content

CreateCluster

Description

call CreateCluster to create a standard Kubernetes proprietary cluster.

Request Method

POST

Request Path

/apsara/route/CS/CreateCluster

Request Parameters Common Parameters

NameLocationTypeRequiredSample valueDescription
cluster_domainBODYstringNocluster.localcluster local domain name. naming rule: the domain name consists of one or more parts separated by decimal points (.), each part is up to 63 characters, lowercase letters, numbers and dashes (-) can be used, and the beginning and end must be lowercase letters or numbers.
master_instance_typesBODYarray of stringYesecs.n4.xlargeMaster node instance type. For more information about ECS instance specifications, see cloud server user guide instance specifications .
worker_vswitch_idsBODYarray of stringYesvsw-2ze3ds0mdip0hdz8i****virtual switch ID list, value range:[1,20]. To ensure high availability, it is recommended to select virtual switches with different available zones.
addonsBODYarray of addonNoNo sample value for this parameter.cluster component list, when creating a cluster, use addons to specify the cluster components to be installed. network component : required, there are two network types: Flannel and Terway. when creating a cluster, you can choose 1 of them: Flannel network:[{"name":"flannel","config":""}]. Terway network:[{"name": "terway-eniip","config": ""}]. storage component : required, support csi and flexvolume Two types: csi:[{"name": "csi-plugin","config": "" },{ "name": "csi-provisioner","config": ""}]. flexvolume:[{"name": "flexvolume","config": ""}]. log component : optional. It is recommended to enable the cluster audit function. If Log Service is not enabled, the cluster audit function will not be available. use existing SLS Project:[{"name": "logtail-ds","config": "{" IngressDashboardEnabled ": " true "," sls_project_name ": " your_sls_project_name "}"}]. create a new SLS Project:[{"name": "logtail-ds","config": "{" IngressDashboardEnabled ": " true "}"}]. Ingress component : optional, the default installation Ingress component nginx-ingress-controller. install the Ingress and enable the public network:[{"name":"nginx-ingress-controller","config":"{" IngressSlbNetworkType ":" internet "}"}]. prohibit the default installation Ingress:[{"name": "nginx-ingress-controller","config": "","disabled": true}]. event center : optional, open by default. event center provides the ability to store, query, and alert Kubernetes events. Logstore associated with Kubernetes event centers are free within 90 days. Enable event center:[{"name":"ack-node-problem-detector","config":"{" sls_project_name ":" your_sls_project_name "}"}].
proxy_modeBODYstringNoipvskube-proxy proxy mode iptables: mature and stable kube-proxy proxy mode, kubernetes Service service discovery and load balancing are configured with iptables rules, but their performance is generally affected by scale, and they are suitable for clusters with a small number of service. ipvs: high-performance kube-proxy proxy mode, kubernetes Service service discovery and load balancing are configured using Linux IPVS modules, which is suitable for scenarios where clusters have a large number of Service and require high performance for load balancing. default value:ipvs.
instancesBODYarray of stringNoi-2ze4zxnm36vq00xn****instance name.
master_system_disk_categoryBODYstringYescloud_ssdMaster node system disk type, value: cloud_efficiency: efficient cloud disk. cloud_ssd:SSD cloud disk. cloud_essd:ESSD cloud disk. default value:cloud_ssd. Default values may vary for different zones.
cloud_monitor_flagsBODYbooleanNotruewhether the cloud monitoring plug-in is installed in the cluster. Value: true: install the cloud monitoring plug-in. false: cloud monitoring plug-in is not installed. default value:false.
ssh_flagsBODYbooleanNotruewhether public SSH login is open. true: indicates open. false: indicates that it is not open. default value:false.
container_cidrBODYstringYes172.20.0.0/16Pod network address segment and cannot conflict with VPC network segment. When the system automatically creates a VPC, the 172.16.0.0/16 CIDR block is used by default. Note this field is required when creating a cluster of Flannel network types. this field does not need to be filled when creating a cluster of Terway network type.
cluster_typeBODYstringYesKubernetescluster type. Value: Kubernetes:Kubernetes proprietary version ManagedKubernetes: edge managed cluster
endpoint_public_accessBODYbooleanNotruewhether to enable public access. Expose API Server through EIP to realize cluster public network access. true: open public access. false: public network access is not enabled. If you choose not to open, the cluster API Server cannot be accessed through the external network. default value:false.
format_diskBODYbooleanNofalseWhen creating a cluster using an existing instance, whether to mount the data disk of the instance, value: true: store containers and images on the data disk, the original data in the data disk will be lost. Please pay attention to backup the data. false: does not store containers and images on the data disk. default value:false. data disk mounting rules: if the ECS has mounted the data disk and the file system of the last data disk is not initialized, the system will automatically format the data disk as ext4 to store the content/var/lib/docker,/var/lib/kubelet. If no data disk is mounted on the ECS instance, no new data disk will be mounted.
platformBODYstringNoCentOSoperating system release. Value: CentOS AliyunLinux QbootAliyunLinux Qboot Windows WindowsCore default value:AliyunLinux.
service_cidrBODYstringYes172.21.0.0/20Service network address segment, optional range: 10.0.0.0/16-24,172.16-31.0.0/16-24,192.168.0.0/16-24 cannot be duplicated with VPC network segment 10.1.0.0/21 and the network segment used by existing Kubernetes clusters in VPC, and cannot be modified after successful creation. uses the 172.19.0.0/20 network segment by default.
node_port_rangeBODYstringNo30000~32767node service port, optional port range:[30000,65535]. default value:30000-32767.
login_passwordBODYstringYesHello@1234SSH login password, and key_pair choose 1. The password rule is 8 to 30 characters in length and contains at least three items (uppercase and lowercase letters, numbers, and special symbols).
keep_instance_nameBODYbooleanNotrueWhen creating a cluster using an existing instance, whether to keep the instance name. true: reserved. false: Not reserved, it will be replaced with system rules. default value:true.
kubernetes_versionBODYstringNo1.16.9-aliyun.1cluster version, consistent with the Kubernetes community baseline version. It is recommended to select the latest version. If not specified, the latest version is used by default. Currently, you can create two latest versions of clusters in the ACK console. You can use API to create other Kubernetes versions of clusters.
is_enterprise_security_groupBODYbooleanNotrueautomatically create enterprise security groups, it takes effect when security_group_id is empty. Note When using a normal security group, the sum of the number of nodes and Terway Pods in the cluster cannot exceed 2000. Therefore, when creating a Terway network cluster, we recommend that you use an enterprise security group. true: create and use enterprise security groups. false: enterprise security groups are not used. default value:true.
master_system_disk_sizeBODYlongYes120Master node system disk type, value range [40,500], unit: GiB. default value:120.
master_countBODYlongNo3Master number of nodes, optional value 3 or 5. default value:3.
num_of_nodesBODYlongYes3Worker nodes. The range is [0,100].
worker_instance_typesBODYarray of stringYesecs.n4.largeWorker node instance specification, at least one instance specification must be specified. For more information, please refer to the ECS guide section instance specifications . Description The instance specification priority decreases as the position in the data increases. When an instance cannot be created based on an instance type with a higher priority, the instance type with the next priority is automatically selected to create the instance.
deletion_protectionBODYbooleanNotruecluster deletion protection to prevent misdeletion of clusters through the console or API. Value: true: enable cluster deletion protection, and clusters cannot be deleted through the console or API. false: cluster deletion protection is not enabled, the cluster can be deleted through the console or API. default value:false.
region_idBODYstringYescn-beijingthe region ID of the cluster.
snat_entryBODYbooleanNotrueConfigure SNAT for the VPC. Value: true: NAT gateway will be created for you and SNAT rules will be automatically configured, if nodes and applications in your cluster need to access the public network, set it to true. false: does not create NAT gateways and SNAT rules for you. In this mode, nodes and applications in the cluster will not be able to access the public network. default value: true.
user_caBODYstringNo-----BEGIN CERTIFICATE-----****custom cluster CA.
worker_system_disk_categoryBODYstringYescloud_efficiencyWorker node system disk type, value: cloud_efficiency: efficient cloud disk. cloud_ssd:SSD cloud disk. default value:cloud_ssd.
runtimeBODYruntimeNo{"name": "docker", "version": "19.03.5"}when the container is running, support containerd, docker, Sandboxed-Container.runv when, the default is docker. The runtime includes the following 2 messages: name: container runtime name. version: container runtime version.
master_vswitch_idsBODYarray of stringYesvsw-2ze3ds0mdip0hdz8i****virtual swap ID.
user_dataBODYstringNoIyEvdXNyL2Jpbi9iYXNoCmVjaG8gIkhlbGxvIEFD****custom node data. For more information, see instance custom data in ECS.
taintsBODYarray of taintNoNo sample value for this parameter.node taint information. Stain and tolerance (Toleration) cooperate with each other and can be used to prevent Pod from being assigned to inappropriate nodes.
versionBODYstringNo2016-01-01version of api
node_cidr_maskBODYstringNo25the number of node IP. the number of IP is determined by specifying the CIDR of the network, which is only valid for Flannel network type clusters. default value:26.
tagsBODYarray of tagNoNo sample value for this parameter.node label. Label definition rules: tags consist of case-sensitive key-value pairs. you can set up to 20 tags. the tag key cannot be repeated, with a maximum length of 64 characters; The tag value can be empty and a maximum length of 128 characters. Neither the tag key nor the tag value can start with "aliyun", "acs:", "https://", or "http.
OS _typeBODYstringNoLinuxoperating system platform type. Value: Windows Linux default value:Linux.
timeout_minsBODYlongNo60cluster creation timeout, in minutes. default value:60.
regionIdBODYstringYesNo sample value for this parameter.region id
worker_system_disk_sizeBODYlongYes120Worker node system disk size, unit is GiB. Value range:[40,500]. the value of this parameter must be greater than or equal to max{40, ImageSize}. default value: 120.
vpcidBODYstringYesvpc-2zeik9h3ahvv2zz95****The proprietary network used by the cluster must be provided for the cluster when creating the cluster.
cpu_policyBODYstringNononenode CPU management policy. The following two policies are supported when the cluster version is 1.12.6 and above: static: allows Pods with certain resource characteristics on the node to enhance their CPU affinity and exclusivity. none: indicates that the existing default CPU affinity scheme is enabled. default value:none.
nameBODYstringYescluster-democluster name. naming rule: consists of numbers, Chinese characters, English characters, or dashes (-), and the length ranges from 1 to 63 characters, and cannot start with a dash (-).
worker_data_disksBODYarrayNoNo sample value for this parameter.a combination of configurations such as worker node data disk type and size.
disable_rollbackBODYbooleanNotruewhether the cluster creation fails to be rolled back. Value: true: when the cluster creation fails, the rollback operation is performed. false: When the cluster creation fails, no rollback operation is performed. default value:true.
image_idBODYstringNom-bp16z7xko3vvv8gt****node custom image, the system image is used by default. When custom image is selected, the default system image will be replaced.

Return data

NameTypeSample valueDescription
cluster_idstringcb95aa626a47740afbf6aa099b650****cluster ID.
task_idstringT-5a54309c80282e39ea00002ftask ID.
request_idstring687C5BAA-D103-4993-884B-C35E4314A1E1request ID.

Example

Successful Response example

{
"cluster_id":"cb95aa626a47740afbf6aa099b650****",
"task_id":"T-5a54309c80282e39ea00002f",
"request_id":"687C5BAA-D103-4993-884B-C35E4314A1E1"
}

Failed Response example

{
"errorSample":
{
"resultCode":-1,
"resultMsg":"system error",
"result":null
}

}