Creating a Cluster
Function
This API is used to create an empty cluster, which has only master nodes but no worker nodes. After creating a cluster by calling this API, you can add nodes by creating nodes.

- The URL for cluster management is in the format of https://Endpoint/uri, in which uri indicates the resource path, that is, the path for API access.
- By default, ICAgent is not installed when you call this API to create a cluster. If you need to install ICAgent, add "cluster.install.addons.external/install":"[{"addonTemplateName":"icagent"}]" to annotations in the request body. ICAgent will be automatically installed during cluster creation. ICAgent is an O&M data collection agent used by Application Performance Management (APM). It runs on each server to collect data from probes in real time. ICAgent is the prerequisite for achieving application O&M. If ICAgent is not installed, the application O&M functions cannot be used.
Constraints
Before calling the CCE API to create a cluster, ensure that the following conditions are met:
- A VPC is available. Otherwise, the cluster cannot be created. If a VPC is available, you do not need to create a new one. A VPC provides an isolated, configurable, manageable virtual network environment for CCE clusters.
- Before creating a cluster, you should properly plan the container and Service CIDR blocks. After a cluster using a container tunnel network is created, you cannot modify the CIDR blocks. After a cluster using a VPC network or Cloud Native 2.0 network is created, you can only add CIDR blocks to the cluster but cannot modify the existing CIDR blocks. To modify the existing CIDR blocks, you need to create a new cluster. Exercise caution when performing this operation.
- An agency has been correctly created and is not deleted. If the agency verification fails, the cluster fails to be created. You can log in to the CCE console to see if there is any agency. If no agency is created, the system prompts you to create one. If an agency has been created, no message is displayed.
- By default, an account can create up to five clusters in each region. If you need to create more clusters, you can submit an application to increase the quota.
URI
POST /api/v3/projects/{project_id}/clusters
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. |
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 |
---|---|---|---|
kind |
Yes |
String |
API type. The value is fixed at Cluster or cluster and cannot be changed. |
apiVersion |
Yes |
String |
API version. The value is fixed at v3 and cannot be changed. |
metadata |
Yes |
ClusterMetadata object |
Basic information about a cluster. Metadata is a collection of attributes. |
spec |
Yes |
ClusterSpec object |
Detailed description of the cluster. CCE creates or updates objects by defining or updating spec. |
status |
No |
ClusterStatus object |
Cluster status and job ID of the cluster creation job. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
Yes |
String |
Cluster name. Enter 4 to 128 characters, starting with a lowercase letter and not ending with a hyphen (-). Only lowercase letters, digits, and hyphens (-) are allowed. |
uid |
No |
String |
Cluster ID, which uniquely identifies a cluster. This ID is automatically generated after a cluster is created. Only the automatically generated ID will take effect. |
alias |
No |
String |
Alias of a cluster name displayed on the CCE console, and the name can be changed. Enter 4 to 128 characters starting with a letter and not ending with a hyphen (-). Only digits, letters, and hyphens (-) are allowed. A cluster alias must be unique. In the request body for creating or updating a cluster, if the cluster alias is not specified or is left blank, the alias of the cluster is the same as the cluster name. In the response body for obtaining a cluster, if the cluster alias is not configured, the cluster alias will not be returned. |
annotations |
No |
Map<String,String> |
Cluster annotations, in the format of key-value pairs. "annotations": { "key1" : "value1", "key2" : "value2" }
NOTE:
|
labels |
No |
Map<String,String> |
Cluster labels, in the format of key-value pairs.
NOTE:
The value of this field is automatically generated by the system and is used by the frontend to identify the features supported by the cluster during the upgrade. Customized values are invalid. |
creationTimestamp |
No |
String |
Time when the cluster was created. |
updateTimestamp |
No |
String |
Time when the cluster was updated. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
category |
No |
String |
Cluster type. Options:
|
type |
No |
String |
Master node architecture:
|
flavor |
Yes |
String |
Cluster specifications. Specifications of clusters 1.15 or later versions can be changed after they are created. For details, see Modifying Cluster Specifications. Options:
NOTE:
The fields in the parameters are described as follows:
|
version |
No |
String |
Version of a cluster, which mirrors the baseline version of the Kubernetes community. The latest version is recommended. You can create clusters of the latest three versions on the CCE console. To learn which cluster versions are available, log in to the CCE console, create a cluster, and check supported cluster versions. You can call APIs to create clusters of other versions. However, these cluster versions will be gradually terminated. For details about the support policy, see the CCE announcement.
NOTE:
|
platformVersion |
No |
String |
CCE cluster platform version, indicating the internal version under the cluster version (version). Platform versions are used to trace iterations in a major cluster version. They are unique within a major cluster version and recounted when the major cluster version changes. This parameter cannot be customized. When you create a cluster, the latest corresponding platform version is automatically selected. The format of platformVersion is cce.X.Y.
|
legacyVersion |
No |
String |
(Discarded) Outdated version of CCE clusters, which serves no practical purpose and is only used to showcase the cluster version and platform version combination. The version number is globally unique. For example, if the cluster version is va.b and the platformVersion is cce.X.Y, the value of legacyVersion is va.b.X-rY. |
description |
No |
String |
Cluster description, for example, which purpose the cluster is intended to serve. By default, this field is left unspecified. To modify cluster description after the cluster is created, call the API for updating cluster information or go to the cluster details page on the CCE console. Only UTF-8 encoding is supported. |
customSan |
No |
Array of strings |
Custom SAN field in the server certificate of the cluster API server, which must comply with the SSL and X509 format specifications.
Example: SAN 1: DNS Name=example.com SAN 2: DNS Name=www.example.com SAN 3: DNS Name=example.net SAN 4: IP Address=93.184.216.34 |
ipv6enable |
No |
Boolean |
Whether a cluster supports IPv6 addresses. It is supported by clusters 1.15 and later.
NOTE:
After IPv6 is enabled, iptables is not supported. The VPC network model does not support IPv4/IPv6 dual-stack. |
hostNetwork |
Yes |
HostNetwork object |
Node networking parameters, including VPC and subnet ID. This field is mandatory because nodes in a cluster communicate with each other by using a VPC. |
containerNetwork |
Yes |
ContainerNetwork object |
Container networking parameters, including the container network model and container CIDR block. |
serviceNetwork |
No |
ServiceNetwork object |
Service CIDR block, including IPv4 CIDR blocks. |
publicAccess |
No |
PublicAccess object |
Cluster API access control. |
authentication |
No |
Authentication object |
Configurations of the cluster authentication mode. |
billingMode |
No |
Integer |
Billing mode of a cluster.
Defaults to pay-per-use. |
masters |
No |
Array of MasterSpec objects |
Advanced configurations of the master nodes. If this parameter is not configured, no value is returned. |
kubernetesSvcIpRange |
No |
String |
Service CIDR blocks for Kubernetes clusterIPs. This field is available only for clusters of v1.11.7 and later. If this parameter is not specified during cluster creation, the default value 10.247.0.0/16 will be used. This parameter is deprecated. Use serviceNetwork instead. The new field contains the IPv4 CIDR blocks. |
clusterTags |
No |
Array of ResourceTag objects |
Cluster resource tags. |
kubeProxyMode |
No |
String |
Service forwarding mode. Options:
NOTE:
iptables is used by default. |
az |
No |
String |
AZ. This field is returned only for a query. |
extendParam |
No |
ClusterExtendParam object |
Extended field to decide whether the cluster will span across AZs or belong to a specified enterprise project, or whether a dedicated CCE cluster is to be created. |
supportIstio |
No |
Boolean |
Whether Istio is supported. |
configurationsOverride |
No |
Array of PackageConfiguration objects |
Cluster default component configuration override. If you specify a component or parameter that is not supported, the configuration item will be ignored. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
vpc |
Yes |
String |
ID of the VPC used to create a master node. You can obtain it in either of the following ways:
|
subnet |
Yes |
String |
Network ID of the subnet used to create a master node. You can obtain it in either of the following ways:
|
SecurityGroup |
No |
String |
Default worker node security group ID of the cluster. If specified, the cluster will be bound to the target security group. Otherwise, the system will automatically create a default worker node security group for you. The default worker node security group needs to allow access from certain ports to ensure normal communications. |
controlPlaneSecurityGroup |
No |
String |
Security group ID of the cluster control plane node, which is automatically generated after the cluster is created. A user-defined value will not take effect. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
mode |
Yes |
String |
Container network model. Select one of the following possible values:
|
cidr |
No |
String |
Container CIDR block. Recommended: 10.0.0.0/12-19, 172.16.0.0/16-19, or 192.168.0.0/16-19. If the selected CIDR block conflicts with existing ones, an error will be reported. Not editable after the cluster is created. (This parameter has been discarded. A specified cidrs will make cidr invalid.) Once you have created a cluster that uses a VPC network, you can add new CIDR blocks, but you are unable to modify the existing ones. If you need to adjust the CIDR blocks, you will have to create a new cluster. If this parameter is left blank, a unique CIDR block is randomly allocated from 172.(16–31).0.0/16 and 10.(0 | 16 | 32 | 48 | 64 | 80 | 96 | 112).0.0/12. |
cidrs |
No |
Array of ContainerCIDR objects |
List of container CIDR blocks In clusters of v1.21 or later, the cidrs field is used. When the cluster network type is vpc-router, you can configure a maximum of 20 container CIDR blocks. In cluster versions earlier than v1.21, if the cidrs field is used, the first CIDR element in the array is used as the container CIDR block. Once you have created a cluster that uses a container tunnel network, you cannot modify the CIDR blocks. Once you have created a cluster that uses a VPC network, you can add new CIDR blocks, but you are unable to modify the existing ones. If you need to adjust the CIDR blocks, you will have to create a new cluster. If this parameter is left blank, a unique CIDR block is randomly allocated from 172.(16–31).0.0/16 and 10.(0 | 16 | 32 | 48 | 64 | 80 | 96 | 112).0.0/12. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
cidr |
Yes |
String |
Container CIDR block. Recommended: 10.0.0.0/12-19, 172.16.0.0/16-19, or 192.168.0.0/16-19. If the selected CIDR block conflicts with existing ones, an error will be reported. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
eniSubnetId |
Yes |
String |
IPv4 subnet ID of ENI subnet. (IPv6 is not supported and is being discarded.) You can obtain it in either of the following ways:
|
eniSubnetCIDR |
No |
String |
ENI subnet CIDR (being discarded) |
subnets |
Yes |
Array of NetworkSubnet objects |
List of IPv4 subnet IDs |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
subnetID |
Yes |
String |
IPv4 subnet ID of the subnet for creating master nodes. IPv6 is not supported. You can obtain it in either of the following ways:
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
IPv4CIDR |
No |
String |
Value range of the Kubernetes clusterIP IPv4 CIDR blocks. If this parameter is not specified during cluster creation, the default value 10.247.0.0/16 will be used. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
cidrs |
No |
Array of strings |
Trustlist of network CIDRs that are allowed to access cluster APIs. You are advised to allow the traffic from VPC and container network CIDRs. By default, no trustlist is configured, and the value is ["0.0.0.0/0"].
NOTE:
This parameter is valid only when a cluster is created. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
mode |
No |
String |
Cluster authentication mode.
|
authenticatingProxy |
No |
AuthenticatingProxy object |
Configuration related to the authenticating_proxy mode. This field is mandatory when the authentication mode is authenticating_proxy. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
ca |
No |
String |
X509 CA certificate (Base64-encoded) configured in authenticating_proxy mode. This field is mandatory when the cluster authentication mode is authenticating_proxy. Maximum size: 1 MB |
cert |
No |
String |
Client certificate issued by the X509 CA certificate configured in authenticating_proxy mode, which is used for authentication from kube-apiserver to the extended API server. (The value must be Base64-encoded.) This field is mandatory when the cluster authentication mode is authenticating_proxy. Maximum size: 1 MB |
privateKey |
No |
String |
Private key of the client certificate issued by the X509 CA certificate configured in authenticating_proxy mode, which is used for authentication from kube-apiserver to the extended API server. The private key used by the Kubernetes cluster does not support password encryption. Use an unencrypted private key. (The value must be Base64-encoded.) This field is mandatory when the cluster authentication mode is authenticating_proxy. Maximum size: 1 MB |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
key |
No |
String |
Key.
|
value |
No |
String |
Value.
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
clusterAZ |
No |
String |
AZ of master nodes in a cluster.
|
dssMasterVolumes |
No |
String |
Whether the system and data disks of a master node use dedicated distributed storage. If this parameter is omitted or left unspecified, EVS disks are used by default. This parameter is mandatory for dedicated CCE clusters. It is in the following format: <rootVol.dssPoolID>.<rootVol.volType>;<dataVol.dssPoolID>.<dataVol.volType> Field description:
Example: c950ee97-587c-4f24-8a74-3367e3da570f.sas;6edbc2f4-1507-44f8-ac0d-eed1d2608d38.ssd
NOTE:
This field cannot be configured for non-dedicated CCE clusters. |
enterpriseProjectId |
No |
String |
ID of the enterprise project that a cluster belongs to
NOTE:
|
kubeProxyMode |
No |
String |
Service forwarding mode. Two modes are available:
NOTE:
This parameter has been deprecated. If this parameter and kubeProxyMode in ClusterSpec are specified at the same time, the latter is used. |
clusterExternalIP |
No |
String |
EIP of the master node |
alpha.cce/fixPoolMask |
No |
String |
Number of mask bits of the fixed IP address pool of the container networks. It is supported only by the VPC network model (vpc-router). The number of mask bits and maxPods configured during node creation determine how many IP addresses can be allocated to containers from a node and how many pods can be created in a node. For details, see Maximum Number of Pods That Can Be Created on a Node. For integer characters, the value ranges from 24 to 28. |
decMasterFlavor |
No |
String |
Specifications of the master node in the dedicated hybrid cluster. |
dockerUmaskMode |
No |
String |
Default UmaskMode configuration of Docker in a cluster. The value can be secure or normal. If this parameter is not specified, normal is used by default. |
kubernetes.io/cpuManagerPolicy |
No |
String |
Cluster CPU management policy. The value can be none (or null) or static. The default value is none (or null).
|
upgradefrom |
No |
String |
Records of how the cluster is upgraded to the current version |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
No |
String |
Component name. |
configurations |
No |
Array of ConfigurationItem objects |
Component configuration item. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
No |
String |
Component configuration item name. |
value |
No |
Object |
Component configuration item value. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
phase |
No |
String |
Cluster status. Options:
|
jobID |
No |
String |
ID of the task associated with the cluster in the current state. Options:
NOTE:
Tasks are short-lived. Do not use task information in scenarios such as cluster status determination. |
reason |
No |
String |
Reason of cluster state change. This parameter is returned if the cluster is not in the Available state. |
message |
No |
String |
Detailed information about why the cluster changes to the current state. This parameter is returned if the cluster is not in the Available state. |
endpoints |
No |
Array of ClusterEndpoints objects |
Access address of kube-apiserver in the cluster. |
deleteOption |
No |
Object |
Whether to delete configurations. This parameter is contained only in the response to the deletion request. |
deleteStatus |
No |
Object |
Whether to delete the status information. This parameter is contained only in the response to the deletion request. |
Response Parameters
Status code: 201
Parameter |
Type |
Description |
---|---|---|
kind |
String |
API type. The value is fixed at Cluster or cluster and cannot be changed. |
apiVersion |
String |
API version. The value is fixed at v3 and cannot be changed. |
metadata |
ClusterMetadata object |
Basic information about a cluster. Metadata is a collection of attributes. |
spec |
ClusterSpec object |
Detailed description of the cluster. CCE creates or updates objects by defining or updating spec. |
status |
ClusterStatus object |
Cluster status and job ID of the cluster creation job. |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Cluster name. Enter 4 to 128 characters, starting with a lowercase letter and not ending with a hyphen (-). Only lowercase letters, digits, and hyphens (-) are allowed. |
uid |
String |
Cluster ID, which uniquely identifies a cluster. This ID is automatically generated after a cluster is created. Only the automatically generated ID will take effect. |
alias |
String |
Alias of a cluster name displayed on the CCE console, and the name can be changed. Enter 4 to 128 characters starting with a letter and not ending with a hyphen (-). Only digits, letters, and hyphens (-) are allowed. A cluster alias must be unique. In the request body for creating or updating a cluster, if the cluster alias is not specified or is left blank, the alias of the cluster is the same as the cluster name. In the response body for obtaining a cluster, if the cluster alias is not configured, the cluster alias will not be returned. |
annotations |
Map<String,String> |
Cluster annotations, in the format of key-value pairs. "annotations": { "key1" : "value1", "key2" : "value2" }
NOTE:
|
labels |
Map<String,String> |
Cluster labels, in the format of key-value pairs.
NOTE:
The value of this field is automatically generated by the system and is used by the frontend to identify the features supported by the cluster during the upgrade. Customized values are invalid. |
creationTimestamp |
String |
Time when the cluster was created. |
updateTimestamp |
String |
Time when the cluster was updated. |
Parameter |
Type |
Description |
---|---|---|
category |
String |
Cluster type. Options:
|
type |
String |
Master node architecture:
|
flavor |
String |
Cluster specifications. Specifications of clusters 1.15 or later versions can be changed after they are created. For details, see Modifying Cluster Specifications. Options:
NOTE:
The fields in the parameters are described as follows:
|
version |
String |
Version of a cluster, which mirrors the baseline version of the Kubernetes community. The latest version is recommended. You can create clusters of the latest three versions on the CCE console. To learn which cluster versions are available, log in to the CCE console, create a cluster, and check supported cluster versions. You can call APIs to create clusters of other versions. However, these cluster versions will be gradually terminated. For details about the support policy, see the CCE announcement.
NOTE:
|
platformVersion |
String |
CCE cluster platform version, indicating the internal version under the cluster version (version). Platform versions are used to trace iterations in a major cluster version. They are unique within a major cluster version and recounted when the major cluster version changes. This parameter cannot be customized. When you create a cluster, the latest corresponding platform version is automatically selected. The format of platformVersion is cce.X.Y.
|
legacyVersion |
String |
(Discarded) Outdated version of CCE clusters, which serves no practical purpose and is only used to showcase the cluster version and platform version combination. The version number is globally unique. For example, if the cluster version is va.b and the platformVersion is cce.X.Y, the value of legacyVersion is va.b.X-rY. |
description |
String |
Cluster description, for example, which purpose the cluster is intended to serve. By default, this field is left unspecified. To modify cluster description after the cluster is created, call the API for updating cluster information or go to the cluster details page on the CCE console. Only UTF-8 encoding is supported. |
customSan |
Array of strings |
Custom SAN field in the server certificate of the cluster API server, which must comply with the SSL and X509 format specifications.
Example: SAN 1: DNS Name=example.com SAN 2: DNS Name=www.example.com SAN 3: DNS Name=example.net SAN 4: IP Address=93.184.216.34 |
ipv6enable |
Boolean |
Whether a cluster supports IPv6 addresses. It is supported by clusters 1.15 and later.
NOTE:
After IPv6 is enabled, iptables is not supported. The VPC network model does not support IPv4/IPv6 dual-stack. |
hostNetwork |
HostNetwork object |
Node networking parameters, including VPC and subnet ID. This field is mandatory because nodes in a cluster communicate with each other by using a VPC. |
containerNetwork |
ContainerNetwork object |
Container networking parameters, including the container network model and container CIDR block. |
serviceNetwork |
ServiceNetwork object |
Service CIDR block, including IPv4 CIDR blocks. |
publicAccess |
PublicAccess object |
Cluster API access control. |
authentication |
Authentication object |
Configurations of the cluster authentication mode. |
billingMode |
Integer |
Billing mode of a cluster.
Defaults to pay-per-use. |
masters |
Array of MasterSpec objects |
Advanced configurations of the master nodes. If this parameter is not configured, no value is returned. |
kubernetesSvcIpRange |
String |
Service CIDR blocks for Kubernetes clusterIPs. This field is available only for clusters of v1.11.7 and later. If this parameter is not specified during cluster creation, the default value 10.247.0.0/16 will be used. This parameter is deprecated. Use serviceNetwork instead. The new field contains the IPv4 CIDR blocks. |
clusterTags |
Array of ResourceTag objects |
Cluster resource tags. |
kubeProxyMode |
String |
Service forwarding mode. Options:
NOTE:
iptables is used by default. |
az |
String |
AZ. This field is returned only for a query. |
extendParam |
ClusterExtendParam object |
Extended field to decide whether the cluster will span across AZs or belong to a specified enterprise project, or whether a dedicated CCE cluster is to be created. |
supportIstio |
Boolean |
Whether Istio is supported. |
configurationsOverride |
Array of PackageConfiguration objects |
Cluster default component configuration override. If you specify a component or parameter that is not supported, the configuration item will be ignored. |
Parameter |
Type |
Description |
---|---|---|
vpc |
String |
ID of the VPC used to create a master node. You can obtain it in either of the following ways:
|
subnet |
String |
Network ID of the subnet used to create a master node. You can obtain it in either of the following ways:
|
SecurityGroup |
String |
Default worker node security group ID of the cluster. If specified, the cluster will be bound to the target security group. Otherwise, the system will automatically create a default worker node security group for you. The default worker node security group needs to allow access from certain ports to ensure normal communications. |
controlPlaneSecurityGroup |
String |
Security group ID of the cluster control plane node, which is automatically generated after the cluster is created. A user-defined value will not take effect. |
Parameter |
Type |
Description |
---|---|---|
mode |
String |
Container network model. Select one of the following possible values:
|
cidr |
String |
Container CIDR block. Recommended: 10.0.0.0/12-19, 172.16.0.0/16-19, or 192.168.0.0/16-19. If the selected CIDR block conflicts with existing ones, an error will be reported. Not editable after the cluster is created. (This parameter has been discarded. A specified cidrs will make cidr invalid.) Once you have created a cluster that uses a VPC network, you can add new CIDR blocks, but you are unable to modify the existing ones. If you need to adjust the CIDR blocks, you will have to create a new cluster. If this parameter is left blank, a unique CIDR block is randomly allocated from 172.(16–31).0.0/16 and 10.(0 | 16 | 32 | 48 | 64 | 80 | 96 | 112).0.0/12. |
cidrs |
Array of ContainerCIDR objects |
List of container CIDR blocks In clusters of v1.21 or later, the cidrs field is used. When the cluster network type is vpc-router, you can configure a maximum of 20 container CIDR blocks. In cluster versions earlier than v1.21, if the cidrs field is used, the first CIDR element in the array is used as the container CIDR block. Once you have created a cluster that uses a container tunnel network, you cannot modify the CIDR blocks. Once you have created a cluster that uses a VPC network, you can add new CIDR blocks, but you are unable to modify the existing ones. If you need to adjust the CIDR blocks, you will have to create a new cluster. If this parameter is left blank, a unique CIDR block is randomly allocated from 172.(16–31).0.0/16 and 10.(0 | 16 | 32 | 48 | 64 | 80 | 96 | 112).0.0/12. |
Parameter |
Type |
Description |
---|---|---|
cidr |
String |
Container CIDR block. Recommended: 10.0.0.0/12-19, 172.16.0.0/16-19, or 192.168.0.0/16-19. If the selected CIDR block conflicts with existing ones, an error will be reported. |
Parameter |
Type |
Description |
---|---|---|
eniSubnetId |
String |
IPv4 subnet ID of ENI subnet. (IPv6 is not supported and is being discarded.) You can obtain it in either of the following ways:
|
eniSubnetCIDR |
String |
ENI subnet CIDR (being discarded) |
subnets |
Array of NetworkSubnet objects |
List of IPv4 subnet IDs |
Parameter |
Type |
Description |
---|---|---|
subnetID |
String |
IPv4 subnet ID of the subnet for creating master nodes. IPv6 is not supported. You can obtain it in either of the following ways:
|
Parameter |
Type |
Description |
---|---|---|
IPv4CIDR |
String |
Value range of the Kubernetes clusterIP IPv4 CIDR blocks. If this parameter is not specified during cluster creation, the default value 10.247.0.0/16 will be used. |
Parameter |
Type |
Description |
---|---|---|
cidrs |
Array of strings |
Trustlist of network CIDRs that are allowed to access cluster APIs. You are advised to allow the traffic from VPC and container network CIDRs. By default, no trustlist is configured, and the value is ["0.0.0.0/0"].
NOTE:
This parameter is valid only when a cluster is created. |
Parameter |
Type |
Description |
---|---|---|
mode |
String |
Cluster authentication mode.
|
authenticatingProxy |
AuthenticatingProxy object |
Configuration related to the authenticating_proxy mode. This field is mandatory when the authentication mode is authenticating_proxy. |
Parameter |
Type |
Description |
---|---|---|
ca |
String |
X509 CA certificate (Base64-encoded) configured in authenticating_proxy mode. This field is mandatory when the cluster authentication mode is authenticating_proxy. Maximum size: 1 MB |
cert |
String |
Client certificate issued by the X509 CA certificate configured in authenticating_proxy mode, which is used for authentication from kube-apiserver to the extended API server. (The value must be Base64-encoded.) This field is mandatory when the cluster authentication mode is authenticating_proxy. Maximum size: 1 MB |
privateKey |
String |
Private key of the client certificate issued by the X509 CA certificate configured in authenticating_proxy mode, which is used for authentication from kube-apiserver to the extended API server. The private key used by the Kubernetes cluster does not support password encryption. Use an unencrypted private key. (The value must be Base64-encoded.) This field is mandatory when the cluster authentication mode is authenticating_proxy. Maximum size: 1 MB |
Parameter |
Type |
Description |
---|---|---|
key |
String |
Key.
|
value |
String |
Value.
|
Parameter |
Type |
Description |
---|---|---|
clusterAZ |
String |
AZ of master nodes in a cluster.
|
dssMasterVolumes |
String |
Whether the system and data disks of a master node use dedicated distributed storage. If this parameter is omitted or left unspecified, EVS disks are used by default. This parameter is mandatory for dedicated CCE clusters. It is in the following format: <rootVol.dssPoolID>.<rootVol.volType>;<dataVol.dssPoolID>.<dataVol.volType> Field description:
Example: c950ee97-587c-4f24-8a74-3367e3da570f.sas;6edbc2f4-1507-44f8-ac0d-eed1d2608d38.ssd
NOTE:
This field cannot be configured for non-dedicated CCE clusters. |
enterpriseProjectId |
String |
ID of the enterprise project that a cluster belongs to
NOTE:
|
kubeProxyMode |
String |
Service forwarding mode. Two modes are available:
NOTE:
This parameter has been deprecated. If this parameter and kubeProxyMode in ClusterSpec are specified at the same time, the latter is used. |
clusterExternalIP |
String |
EIP of the master node |
alpha.cce/fixPoolMask |
String |
Number of mask bits of the fixed IP address pool of the container networks. It is supported only by the VPC network model (vpc-router). The number of mask bits and maxPods configured during node creation determine how many IP addresses can be allocated to containers from a node and how many pods can be created in a node. For details, see Maximum Number of Pods That Can Be Created on a Node. For integer characters, the value ranges from 24 to 28. |
decMasterFlavor |
String |
Specifications of the master node in the dedicated hybrid cluster. |
dockerUmaskMode |
String |
Default UmaskMode configuration of Docker in a cluster. The value can be secure or normal. If this parameter is not specified, normal is used by default. |
kubernetes.io/cpuManagerPolicy |
String |
Cluster CPU management policy. The value can be none (or null) or static. The default value is none (or null).
|
upgradefrom |
String |
Records of how the cluster is upgraded to the current version |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Component name. |
configurations |
Array of ConfigurationItem objects |
Component configuration item. |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Component configuration item name. |
value |
Object |
Component configuration item value. |
Parameter |
Type |
Description |
---|---|---|
phase |
String |
Cluster status. Options:
|
jobID |
String |
ID of the task associated with the cluster in the current state. Options:
NOTE:
Tasks are short-lived. Do not use task information in scenarios such as cluster status determination. |
reason |
String |
Reason of cluster state change. This parameter is returned if the cluster is not in the Available state. |
message |
String |
Detailed information about why the cluster changes to the current state. This parameter is returned if the cluster is not in the Available state. |
endpoints |
Array of ClusterEndpoints objects |
Access address of kube-apiserver in the cluster. |
deleteOption |
Object |
Whether to delete configurations. This parameter is contained only in the response to the deletion request. |
deleteStatus |
Object |
Whether to delete the status information. This parameter is contained only in the response to the deletion request. |
Example Requests
- Create an HA CCE cluster of v1.29 that has three master nodes and a maximum of 50 worker nodes.
/api/v3/projects/{project_id}/clusters { "kind" : "Cluster", "apiVersion" : "v3", "metadata" : { "name" : "cluster" }, "spec" : { "category" : "CCE", "flavor" : "cce.s2.small", "version" : "v1.29", "hostNetwork" : { "vpc" : "030bfb19-5fa7-42ad-8a0d-c0721d268867", "subnet" : "ca964acf-8468-4735-8229-97940ef6c881" }, "containerNetwork" : { "mode" : "vpc-router", "cidr" : "10.0.0.0/16" }, "kubernetesSvcIpRange" : "10.247.0.0/16", "description" : "", "billingMode" : 0, "extendParam" : { "kubeProxyMode" : "iptables", "alpha.cce/fixPoolMask" : "25", "enterpriseProjectId" : "0" }, "authentication" : { "mode" : "rbac" }, "ipv6enable" : false } }
- Create an HA CCE cluster of v1.29 that has three master nodes and a maximum of 50 worker nodes and install ICAgent in the cluster.
/api/v3/projects/{project_id}/clusters { "kind" : "Cluster", "apiVersion" : "v3", "metadata" : { "name" : "cluster", "annotations" : { "cluster.install.addons.external/install" : "[{\"addonTemplateName\":\"icagent\"}]" } }, "spec" : { "category" : "CCE", "flavor" : "cce.s2.small", "version" : "v1.29", "hostNetwork" : { "vpc" : "030bfb19-5fa7-42ad-8a0d-c0721d268867", "subnet" : "ca964acf-8468-4735-8229-97940ef6c881" }, "containerNetwork" : { "mode" : "vpc-router", "cidr" : "10.0.0.0/16" }, "kubernetesSvcIpRange" : "10.247.0.0/16", "description" : "", "billingMode" : 0, "extendParam" : { "kubeProxyMode" : "iptables", "alpha.cce/fixPoolMask" : "25", "enterpriseProjectId" : "0" }, "authentication" : { "mode" : "rbac" }, "ipv6enable" : false } }
- Create an HA CCE cluster of v1.29 that has three master nodes and a maximum of 50 worker nodes and configure the custom default security group for nodes in the cluster.
/api/v3/projects/{project_id}/clusters { "kind" : "Cluster", "apiVersion" : "v3", "metadata" : { "name" : "cluster" }, "spec" : { "category" : "CCE", "flavor" : "cce.s2.small", "version" : "v1.29", "hostNetwork" : { "vpc" : "030bfb19-5fa7-42ad-8a0d-c0721d268867", "subnet" : "ca964acf-8468-4735-8229-97940ef6c881", "SecurityGroup" : "a4ef108c-2ec6-492f-a6c4-7b64e25ae490" }, "containerNetwork" : { "mode" : "vpc-router", "cidr" : "10.0.0.0/16" }, "kubernetesSvcIpRange" : "10.247.0.0/16", "description" : "", "billingMode" : 0, "extendParam" : { "kubeProxyMode" : "iptables", "alpha.cce/fixPoolMask" : "25", "enterpriseProjectId" : "0" }, "authentication" : { "mode" : "rbac" }, "ipv6enable" : false } }
- Create an HA CCE cluster of v1.25 with three master nodes and a maximum of 50 worker nodes.
/api/v3/projects/{project_id}/clusters { "kind" : "Cluster", "apiVersion" : "v3", "metadata" : { "name" : "cluster" }, "spec" : { "category" : "Turbo", "flavor" : "cce.s2.small", "version" : "v1.25", "type" : "VirtualMachine", "hostNetwork" : { "vpc" : "030bfb19-5fa7-42ad-8a0d-c0721d268867", "subnet" : "ca964acf-8468-4735-8229-97940ef6c881" }, "containerNetwork" : { "mode" : "eni" }, "eniNetwork" : { "eniSubnetId" : "861fb11d-2f0e-4c10-a98a-166dc26e4ff7", "eniSubnetCIDR" : "192.168.0.0/24", "subnets" : [ { "subnetID" : "861fb11d-2f0e-4c10-a98a-166dc26e4ff7" } ] }, "serviceNetwork" : { "IPv4CIDR" : "10.247.0.0/16" }, "description" : "", "billingMode" : 0, "extendParam" : { "kubeProxyMode" : "iptables", "enterpriseProjectId" : "0" }, "authentication" : { "mode" : "rbac" }, "ipv6enable" : false } }
- Configure the trustlist network CIDR for accessing the cluster API when creating a cluster.
/api/v3/projects/{project_id}/clusters { "kind" : "Cluster", "apiVersion" : "v3", "metadata" : { "name" : "cluster" }, "spec" : { "category" : "CCE", "flavor" : "cce.s2.small", "version" : "v1.19", "hostNetWork" : { "vpc" : "030bfb19-5fa7-42ad-8a0d-c0721d268867", "subnet" : "ca964acf-8468-4735-8229-97940ef6c881" }, "publicAccess" : { "cidrs" : [ "192.168.0.0/16" ] }, "containerNetWork" : { "mode" : "vpc-router", "cidr" : "10.0.0.0/16" }, "serviceNetwork" : { "IPv4CIDR" : "10.247.0.0/16", "IPv6CIDR" : "fc00::/112" }, "kubernetesSvcIpRange" : "10.247.0.0/16", "description" : "", "billingMode" : 0, "extendParam" : { "kubeProxyMode" : "iptables", "alpha.cce/fixPoolMask" : "25", "enterpriseProjectId" : "0" }, "authentication" : { "mode" : "rbac" }, "ipv6enable" : false } }
Example Responses
Status code: 201
The cluster creation job is successfully delivered.
{ "kind" : "Cluster", "apiVersion" : "v3", "metadata" : { "name" : "cluster", "uid" : "1df09f9a-5b9e-11ef-8f52-0255ac10003e", "creationTimestamp" : "2024-08-16 07:06:53.704389459 +0000 UTC", "updateTimestamp" : "2024-08-16 07:06:53.704389529 +0000 UTC", "annotations" : { "jobid" : "1e50bfbe-5b9e-11ef-8f52-0255ac10003e", "resourceJobId" : "1df0ec6b-5b9e-11ef-8f52-0255ac10003e" }, "timezone" : "******", "ownerReferences" : { } }, "spec" : { "publicAccess" : { }, "category" : "CCE", "type" : "VirtualMachine", "enableAutopilot" : false, "maintenanceWindow" : null, "flavor" : "cce.s1.small", "version" : "v1.29", "platformVersion" : "cce.4.0", "configurationsOverride" : [ { "name" : "kube-apiserver", "configurations" : [ { "name" : "support-overload", "value" : true } ] } ], "hostNetwork" : { "vpc" : "0538a5d0-9a65-4c1d-a8bf-e9acee237980", "subnet" : "bc81be88-6e34-4b02-83bd-df0a1f7672c5" }, "containerNetwork" : { "mode" : "vpc-router", "cidr" : "172.17.0.0/16", "cidrs" : [ { "cidr" : "172.17.0.0/16" } ] }, "eniNetwork" : { }, "serviceNetwork" : { "IPv4CIDR" : "10.247.0.0/16" }, "clusterOps" : { }, "authentication" : { "mode" : "rbac", "authenticatingProxy" : { } }, "billingMode" : 0, "kubernetesSvcIpRange" : "10.247.0.0/16", "kubeProxyMode" : "iptables", "extendParam" : { "alpha.cce/fixPoolMask" : "25", "enterpriseProjectId" : "0", "orderID" : "" }, "encryptionConfig" : { "mode" : "Default" }, "deletionProtection" : false }, "status" : { "phase" : "Creating", "jobID" : "1e50bfbe-5b9e-11ef-8f52-0255ac10003e" } }
Status Codes
Status Code |
Description |
---|---|
201 |
The cluster creation job 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.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot