180 KiB

original_name

cce_02_0236.html

Creating a Cluster

Function

This API is used to create an empty cluster, which has only master nodes but do not have worker nodes. After creating a cluster by calling this API, you can add nodes to the cluster. For details, see Creating a Node <cce_02_0242>.

Note

  • The URL for cluster management is in the format of https://Endpoint/uri. In the URL, uri indicates the resource path, that is, the path for API access.
  • Info collect agent (ICAgent) is an O&M data collection agent used by Application Performance Management (APM) service. It runs on each server to collect data from probes in real time. When this API is called to create a cluster, ICAgent is not installed by default. To automatically install ICAgent during cluster creation, add "cluster.install.addons.external/install": "[{\"addonTemplateName\":\"icagent\"}]" to the annotations field in the request body.
  • Before creating a cluster, Creating a VPC and Subnet <cce_02_0100>. If a VPC and subnet already exists, you do not need to create them again.
  • By default, an account can create a maximum of five clusters in each region.

URI

POST /api/v3/projects/{project_id}/clusters

Table 1 <cce_02_0236__table2027961241820> describes the parameters of this API.

Table 1 Parameters
Parameter Mandatory Description
project_id Yes Project ID. For details about how to obtain the project ID, see How to Obtain Parameters in the API URI <cce_02_0271>.

Request

Request parameters:

Table 2 <cce_02_0236__table165001054142614> and Table 3 <cce_02_0236__table34052983203655> describe the request parameters.

Table 2 Parameters in the request header
Parameter Mandatory String Description
Content-Type Yes String

Message body type (format).

Default: application/json

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 on how to obtain a user token, see API Usage Guidelines <cce_02_0344>.
Table 3 Parameters in the request body
Parameter Mandatory Type Description
kind Yes String API type. For a cluster management API, the parameter must be set to Cluster and cannot be changed.
apiVersion Yes String API version. The value is fixed at v3 and cannot be changed.
metadata Yes metadata <cce_02_0236__table888212551117> object Basic information about a cluster. metadata is a collection of attributes.
spec Yes spec <cce_02_0236__table1034041612134> object Detailed description of the cluster to be created. CCE creates or updates objects by defining or updating its spec.
Table 4 Data structure of the metadata field
Parameter Mandatory Type Description
name Yes String

Cluster name.

Enter 4 to 128 characters starting with a letter and not ending with a hyphen (-). Only lowercase letters, digits, and hyphens (-) are allowed.

uid No String Unique resource ID, which is automatically generated after the resource is created. It cannot be specified.
labels No Object

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. The value specified by the user is invalid.

annotations No Object

Cluster annotations in the format of key-value pairs.

"annotations": {
   "key1" : "value1",
   "key2" : "value2"
}

Note

  • Annotations are not used to identify or select objects. The metadata in annotations may be small or large, structured or unstructured, and may include characters that are not allowed in labels.
  • This field is not stored in the database and is used only to specify the add-ons to be installed in the cluster.
Table 5 Data structure of the spec field
Parameter Mandatory Type Description
category No String

Cluster category:

  • CCE: CCE cluster
  • Turbo: CCE Turbo cluster

Note

This parameter is valid in cluster of v1.17.17 or higher.

type Yes String

Cluster type.

VirtualMachine: The master node architecture is x86.

flavor Yes String

Cluster flavor.

  • cce.s1.small: small-scale, single-master cluster (<= 50 nodes)
  • cce.s1.medium: medium-scale, single-master cluster (<= 200 nodes)
  • cce.s2.small: small-scale, high availability cluster (<= 50 nodes)
  • cce.s2.medium: medium-scale, high availability cluster (<= 200 nodes)
  • cce.s2.large: large-scale, high availability cluster (<= 1,000 nodes)
  • cce.s2.xlarge: ultra-large-scale, high availability cluster (<= 2,000 nodes)

Note

  • s1: single-master cluster
  • s2: high availability cluster
  • For example, <= 50 nodes indicates that the maximum number of nodes that can be managed by the cluster is 50.
  • A single-master cluster has only one master node. If the master node is down, the cluster will become unavailable and stop serving new workloads. However, existing workloads in the cluster are not affected.
  • A high-availability cluster has multiple master nodes. Faults in a single master node will not take the cluster down.
version No String

Cluster version, which mirrors the baseline version of the Kubernetes community. The latest version is recommended.

You can create clusters of two latest versions on the CCE console. To learn which cluster versions are available, choose Dashboard > Create Cluster on the CCE console and check the Version parameter.

You can call APIs to create clusters of other versions. However, these clusters will be gradually brought offline. For details about the offline policy, see the official CCE announcement.

Note

If this parameter is not set, the cluster of the latest version is created by default.

platformVersion No String

Version of the CCE cluster platform, which is for viewing only and cannot be specified during cluster creation. The latest platform version corresponding to the cluster version is automatically selected during cluster creation.

Value format: cce.X.Y

  • X indicates the quarterly or regularly feature version number, starting from 1.
  • Y indicates the patch version of the cluster, starting from 0 (feature version). Other values indicate later patch versions after the feature version is released.
description No String Cluster description, for example, which purpose the cluster is intended to serve. By default, this parameter is left unspecified. To modify cluster description after the cluster is created, call the API that is used to update information about a specified cluster <cce_02_0240> or go to the cluster details page on the CCE console.
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.

  1. Duplicate names are not allowed.
  2. Must comply with the IP address and domain name formats.

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 Reserved. This parameter is not used in the current version.
hostNetwork Yes hostNetwork <cce_02_0236__table1622013552507> object Node network parameters, including a VPC and subnet ID. hostNetwork is mandatory because nodes in a cluster communicate with each other by using a VPC.
containerNetwork Yes containerNetwork <cce_02_0236__table882310145412> object Container network parameters, including a container network model and container CIDR block.
eniNetwork No EniNetwork <cce_02_0236__request_eninetwork> object Configuration of Cloud Native Network 2.0. Specify this field when creating a CCE Turbo cluster.
authentication No authentication <cce_02_0236__table71529332533> object Configurations of the cluster authentication mode.
masters No MasterSpec <cce_02_0236__request_masterspec> objects Advanced configurations of the master node.
kubernetesSvcIpRange No String Service CIDR block or the IP address range which the kubernetes clusterIp must fall within. This parameter is available only for clusters of v1.11.7 and later.
kubeProxyMode No String

Service forwarding mode. Two modes are available:

  • iptables: Traditional kube-proxy uses iptables rules to implement service load balancing. In this mode, too many iptables rules will be generated when many services are deployed. In addition, non-incremental updates will cause a latency and even obvious performance issues in the case of heavy service traffic.
  • ipvs: Optimized kube-proxy mode with higher throughput and faster speed. This mode supports incremental updates and can keep connections uninterrupted during service updates. It is suitable for large-sized clusters.
extendParam No extendParam <cce_02_0236__table17575013586> object

Extended fields in the format of key-value pairs.

If the cluster will span across AZs or belong to a specified enterprise project, set extended fields as described in Table 13 <cce_02_0236__table17575013586>.

Table 6 Data structure of the hostNetwork field
Parameter Mandatory Type Description
vpc Yes String ID of the VPC used to create a master node. The VPC ID is obtained from Creating a VPC and Subnet <cce_02_0100>.
subnet Yes String Network ID of the subnet. The value is obtained from Creating a VPC and Subnet <cce_02_0100>.
SecurityGroup No String Security group ID of the node. The value is generated when you create a security group, and any user-defined value is invalid.
Table 7 Data structure of the authentication field
Parameter Mandatory Type Description
mode No String

Cluster authentication mode.

  • Clusters of Kubernetes v1.11 and earlier
    • Possible values: x509, rbac, and authenticating_proxy
    • Default value: x509
  • Clusters of Kubernetes v1.13 and later
    • Possible values: rbac and authenticating_proxy
    • Default value: rbac
authenticatingProxy No authenticatingProxy <cce_02_0236__table17313161473013> object Configurations of the authenticating_proxy mode.
Table 8 Data structure of the authenticatingProxy field
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. The maximum size of the certificate is 1 MB.

Note

The uploaded CA certificate is used for both the authentication proxy and the kube-apiserver aggregation layer configuration. If the certificate is invalid, the cluster cannot be created. For details about the kube-apiserver aggregation layer, see Configure the Aggregation Layer.

cert No String

Client certificate (Base64-encoded) issued by the X509 CA certificate configured in authenticating_proxy mode. This certificate is used for authentication from kube-apiserver to the extended API server. This field is mandatory when the cluster authentication mode is authenticating_proxy.

For details about the kube-apiserver aggregation layer, see Configure the Aggregation Layer.

privateKey No String

Private key (Base64-encoded) of the client certificate issued by the X509 CA certificate configured in authenticating_proxy mode. This key 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. This field is mandatory when the cluster authentication mode is authenticating_proxy.

For details about the kube-apiserver aggregation layer, see Configure the Aggregation Layer.

Table 9 Data structure of the containerNetwork field
Parameter Mandatory Type Description
mode Yes String

Container network model. Select one of the following possible values:

  • overlay_l2: an overlay_l2 network built for containers by using OpenVSwitch (OVS).
  • vpc-router: an underlay_l2 network built for containers by using ipvlan and custom VPC routes.
  • eni: cloud native 2.0 network model. This model deeply integrates the native ENI capability of VPC, uses the VPC CIDR block to allocate container addresses, and supports passthrough between load balancers and containers to provide high performance. You can use this network model when creating a CCE Turbo cluster.

Note

  • Tunnel network: Under this model, the container network is an overlay network on top of a VPC network based on the VXLAN technology. VXLAN encapsulates Ethernet packets as UDP packets for tunnel transmission. Though at some cost of performance, the tunnel encapsulation enables higher interoperability and compatibility with advanced features (such as network policy-based isolation), meeting the requirements of most applications.
  • VPC network: Routing is implemented within a VPC network according to custom VPC routes. Each node is assigned a CIDR block of a fixed size. vpc-router networks are free of tunnel encapsulation overheads and provide better container network performance than tunnel networks. In addition, as routes to node IP addresses and the containers have been configured on vpc-router, container instances can be directly accessed from outside the cluster.
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 CIDR blocks, the system automatically selects another CIDR block.

This parameter cannot be modified after the cluster is created. Exercise caution when setting this parameter.(This parameter has been discarded. If cidrs has been configured, skip this parameter.)

Minimum: 0

Maximum: 64

Note

This parameter is not valid for CCE Turbo cluster.

cidrs No Array of ContainerCIDR <cce_02_0236__request_containercidr> objects

List of container CIDR blocks. In clusters of v1.21 and later, the cidrs field is used. When the cluster network type is vpc-router, you can add multiple container CIDR blocks. In 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.

The configuration cannot be changed after the cluster is created.

Table 10 ContainerCIDR
Parameter Mandatory Type Description
cidr Yes String Container CIDR block. Recommended: 10.0.0.0/12-19, 172.16.0.0/16-19, and 192.168.0.0/16-19
Table 11 EniNetwork
Parameter Mandatory Type Description
eniSubnetId Yes String IPv4 Subnet ID of the ENI container subnet. Currently, IPv6 is not supported.
eniSubnetCIDR Yes String ENI subnet CIDR block.
Table 12 MasterSpec
Parameter Mandatory Type Description
availabilityZone No String

Availability Zone.

For example:

"masters": [
            {
                "availabilityZone": "eu-de-01"
            },
            {
                "availabilityZone": "eu-de-01"
            },
            {
                "availabilityZone": "eu-de-02"
            }
        ],
Table 13 Data structure of the extendParam field
Parameter Mandatory Type Description
clusterAZ No String

If you want to enable multiple AZs for the cluster, enter {"clusterAZ": "multi_az"}.

Note

Only HA clusters support multiple AZs. To be specific, this field can be configured only when the flavor field in Table 5 <cce_02_0236__table1034041612134> is set to cce.s2.small, cce.s2.medium, cce.s2.large, cce.t2.small, cce.t2.medium, or cce.t2.large. After multi-AZ deployment is enabled, the three master nodes of the cluster are distributed in different AZs. The cluster remains available even when one of the AZs is down.

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.
kubeProxyMode No String

Service forwarding mode. Two modes are available:

  • iptables: Traditional kube-proxy uses iptables rules to implement service load balancing. In this mode, too many iptables rules will be generated when many Services are deployed. In addition, non-incremental updates will cause a latency and even tangible performance issues in the case of service traffic spikes.
  • ipvs: Optimized kube-proxy mode with higher throughput and faster speed. This mode supports incremental updates and can keep connections uninterrupted during service updates. It is suitable for large-sized clusters.

Note

This parameter has been deprecated. If both this parameter and kubeProxyMode under ClusterSpec are specified, the latter will be 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 network model. This field is supported only for the VPC network model (vpc-router).

This parameter determines the number of container IP addresses that can be allocated to a node. The maximum number of pods that can be created on a node is decided by this parameter and maxPods set during node creation.

The value is an integer ranging from 24 to 28.

kubernetes.io/cpuManagerPolicy No String

Cluster CPU management policy. The value can be none or static. The default value is none.

  • none: CPU cores will not be exclusively allocated to workload pods. Select this value if you want a large pool of shareable CPU cores.
  • static: CPU cores can be exclusively allocated to workload pods. Select this value if your workload is sensitive to latency in CPU cache and scheduling.
upgradefrom No String Reserved. This field is returned only for a query.

Example Request

CCE Cluster:

{
    "kind": "Cluster",
    "apiVersion": "v3",
    "metadata": {
        "name": "mycluster",
        "labels": {
            "foo": "bar"
        },
        "annotations": {
            "foo2": "bar2"
        }
    },
    "spec": {
        "type": "VirtualMachine",
        "flavor": "cce.s2.small",
        "version": "v1.19.8-r0",
        "description": "this is a demo cluster",
        "hostNetwork": {
            "vpc": "23d3725f-6ffe-400e-8fb6-b4f9a7b3e8c1",
            "subnet": "c90b3ce5-e1f1-4c87-a006-644d78846438"
        },
        "containerNetwork": {
            "mode": "overlay_l2",
            "cidr": "172.16.0.0/16"
        },
        "authentication": {
            "mode": "rbac",
        },
        "kubeProxyMode": "iptables",
        "billingMode": 0,
        "extendParam": {
            "clusterAZ": "multi_az"
        }
    }
}

CCE Turbo Cluster:

{
    "kind": "Cluster",
    "apiVersion": "v3",
    "metadata": {
        "name": "turbo"
    },
    "spec": {
        "type": "VirtualMachine",
        "flavor": "cce.s2.medium",
        "version": "v1.19.10-r0",
        "hostNetwork": {
            "vpc": "05c33818-78df-4329-b546-5df2f1aa823e",
            "subnet": "9f0c8ef2-c608-4238-88be-87bce5fe90da"
        },
        "containerNetwork": {
            "mode": "eni"
        },
        "eniNetwork": {
            "eniSubnetId": "417dcc1f-95d7-43e7-8533-ab078d266303",
            "eniSubnetCIDR": "192.168.0.0/24"
        },
        "kubernetesSvcIpRange": "10.247.0.0/16",
        "authentication": {
            "mode": "rbac"
        },
        "extendParam": {
            "kubeProxyMode": "ipvs"
        }
    }
}

Response

Response parameters:

Table 14 <cce_02_0236__en-us_topic_0079616779_en-us_topic_0079614912_ref458774242> describes the response parameters.

Table 14 Response parameters
Parameter Type Description
kind String API type. The value is fixed at Cluster and cannot be changed.
apiVersion String API version. The value is fixed at v3 and cannot be changed.
metadata metadata <cce_02_0236__table669019286188> object Cluster metadata, which is a collection of attributes.
spec spec <cce_02_0236__table195921039143517> object Detailed description of the cluster to be created. CCE creates or updates objects by defining or updating its spec.
status status <cce_02_0236__table6749834132215> object Cluster status and jobID of the cluster creation job.
Table 15 Data structure of the metadata field
Parameter Type Description
name String Cluster name.
uid String Cluster ID.
creationTimestamp String Time when the cluster was created.
updateTimestamp String Time when the cluster was updated.
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. The value specified by the user is invalid.

annotations Map<String,String>

Cluster annotations in the format of key-value pairs.

"annotations": { "key1" : "value1", "key2" : "value2" }

Note

  • annotations is not used to identify or select objects. Metadata in annotations can be small or large, structured or unstructured, and can include characters that are not allowed in labels.
  • This field is not stored in the database and is used only to specify the add-ons to be installed the cluster.
Table 16 Data structure of the spec field
Parameter Type Description
category String

Cluster category:

  • CCE: CCE cluster
  • Turbo: CCE Turbo cluster

Note

This parameter is valid in cluster of v1.17.17 or higher.

type String

Cluster type.

VirtualMachine: The master node architecture is x86.

flavor String

Cluster flavor, which cannot be changed after the cluster is created.

  • cce.s1.small: small-scale, single-master cluster (<= 50 nodes)
  • cce.s1.medium: medium-scale, single-master cluster (<= 200 nodes)
  • cce.s2.small: small-scale, high availability cluster (<= 50 nodes)
  • cce.s2.medium: medium-scale, high availability cluster (<= 200 nodes)
  • cce.s2.large: large-scale, high availability cluster (<= 1,000 nodes)
  • cce.s2.xlarge: ultra-large-scale, high availability cluster (<= 2,000 nodes)

Note

  • s1: single-master cluster
  • s2: high availability cluster
  • For example, <= 50 nodes indicates that the maximum number of nodes that can be managed by the cluster is 50.
  • A single-master cluster is a cluster that has only one master node. If the master node is down, the cluster will become unavailable and stop serving new workloads. However, existing workloads in the cluster are not affected.
  • A high-availability cluster has multiple master nodes. Faults in a single master node will not take the cluster down.
version String Cluster's baseline Kubernetes version. The latest version is recommended.
platformVersion String

Version of the CCE cluster platform, which is for viewing only and cannot be specified during cluster creation. The latest platform version corresponding to the cluster version is automatically selected during cluster creation.

Value format: cce.X.Y

  • X indicates the quarterly or regularly feature version number, starting from 1.
  • Y indicates the patch version of the cluster, starting from 0 (feature version). Other values indicate later patch versions after the feature version is released.
description String Cluster description.
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.

  1. Duplicate names are not allowed.
  2. Must comply with the IP address and domain name formats.

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 Reserved. This parameter is not used in the current version.
hostNetwork hostNetwork <cce_02_0236__table14385916163118> object Node network parameters.
containerNetwork containerNetwork <cce_02_0236__table882310145412> object Container network parameters.
eniNetwork EniNetwork <cce_02_0236__table97937811553> object Configuration of Cloud Native Network 2.0. Specify this field when creating a CCE Turbo cluster.
authentication authentication <cce_02_0236__table7220112133716> object Configurations of the cluster authentication mode.
billingMode Integer

Billing mode of a node.

Note

This field is not supported for the current version.

masters Array of MasterSpec <cce_02_0236__response_masterspec> objects Advanced configurations of the master node.
kubernetesSvcIpRange String Service CIDR block or the IP address range which the kubernetes clusterIp must fall within. This parameter is available only for clusters of v1.11.7 and later.
kubeProxyMode String

Service forwarding mode. Two modes are available:

  • iptables: Traditional kube-proxy uses iptables rules to implement service load balancing. In this mode, too many iptables rules will be generated when many services are deployed. In addition, non-incremental updates will cause a latency and even obvious performance issues in the case of heavy service traffic.
  • ipvs: Optimized kube-proxy mode with higher throughput and faster speed. This mode supports incremental updates and can keep connections uninterrupted during service updates. It is suitable for large-sized clusters.
az String AZ. This field is returned only for a query.
extendParam extendParam <cce_02_0236__table0102129153810> object Extended fields in the format of key-value pairs.
supportIstio Boolean

Whether Istio is supported.

Note

This field is not supported for the current version.

Table 17 Data structure of the hostNetwork field
Parameter Type Description
vpc String ID of the VPC used to create a master node. The VPC ID is obtained from Creating a VPC and Subnet <cce_02_0100>.
subnet String Network ID of the subnet. The value is obtained from Creating a VPC and Subnet <cce_02_0100>.
SecurityGroup String Security group ID of the node. The value is generated when you create a security group, and any user-defined value is invalid.
Table 18 EniNetwork
Parameter Mandatory Type Description
eniSubnetId Yes String IPv4 Subnet ID of the ENI container subnet. Currently, IPv6 is not supported.
eniSubnetCIDR Yes String ENI subnet CIDR block.
Table 19 Data structure of the authentication field
Parameter Type Description
mode String

Cluster authentication mode.

  • Clusters of Kubernetes v1.11 or earlier support x509, rbac, and authenticating_proxy. The default value is x509.
  • Clusters of Kubernetes v1.13 or later support rbac and authenticating_proxy. The default value is rbac.
Table 20 MasterSpec
Parameter Type Description
availabilityZone String

Availability Zone.

"masters": [
            {
                "availabilityZone": "eu-de-01"
            },
            {
                "availabilityZone": "eu-de-01"
            },
            {
                "availabilityZone": "eu-de-02"
            }
        ],
Table 21 Data structure of the extendParam field
Parameter Type Description
clusterAZ String

If you want to enable multiple AZs for the cluster, enter {"clusterAZ": "multi_az"}.

Note

Only HA clusters support multiple AZs. To be specific, this field can be configured only when the flavor field in Table 5 <cce_02_0236__table1034041612134> is set to cce.s2.small, cce.s2.medium, cce.s2.large, cce.t2.small, cce.t2.medium, or cce.t2.large. After multi-AZ deployment is enabled, the three master nodes of the cluster are distributed in different AZs. The cluster remains available even when one of the AZs is down.

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.
kubeProxyMode String

Service forwarding mode. Two modes are available:

  • iptables: Traditional kube-proxy uses iptables rules to implement service load balancing. In this mode, too many iptables rules will be generated when many Services are deployed. In addition, non-incremental updates will cause a latency and even tangible performance issues in the case of service traffic spikes.
  • ipvs: Optimized kube-proxy mode with higher throughput and faster speed. This mode supports incremental updates and can keep connections uninterrupted during service updates. It is suitable for large-sized clusters.
clusterExternalIP String EIP used to access the cluster.
alpha.cce/fixPoolMask String

Number of mask bits of the fixed IP address pool of the container network model. This field is supported only for the VPC network model (vpc-router).

This parameter determines the number of container IP addresses that can be allocated to a node. The maximum number of pods that can be created on a node is decided by this parameter and maxPods set during node creation.

The value is an integer ranging from 24 to 28.

kubernetes.io/cpuManagerPolicy String

Cluster CPU management policy. The value can be none or static. The default value is none.

  • none: CPU cores will not be exclusively allocated to workload pods. Select this value if you want a large pool of shareable CPU cores.
  • static: CPU cores can be exclusively allocated to workload pods. Select this value if your workload is sensitive to latency in CPU cache and scheduling.
upgradefrom String Reserved. This field is returned only for a query.
Table 22 Data structure of the status field
Parameter Type Description
phase String

Cluster status. Possible values:

  • Available: The cluster is running properly.
  • Unavailable: The cluster is exhibiting unexpected behavior.
  • ScalingUp: Nodes are being added to the cluster.
  • ScalingDown: The cluster is being downsized to fewer nodes.
  • Creating: The cluster is being created.
  • Deleting: The cluster is being deleted.
  • Upgrading: The cluster is being upgraded.
  • Empty: The cluster has no resources.
jobID String ID of the cluster creation job. You can query job progress <cce_02_0247> by job ID to keep updated on cluster creation progress.
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 response:

"kind": "Cluster",
"apiVersion": "v3",
"metadata": {
    "name": "test-create-cluster",
    "uid": "d6a883a1-8529-11ea-8e34-0255ac101108",
    "creationTimestamp": "2020-04-23 06:15:32.974281119 +0000 UTC",
    "updateTimestamp": "2020-04-23 06:15:32.974281688 +0000 UTC",
    "labels": {
        "foo": "bar"
    },
    "annotations": {
        "foo2": "bar2"
    }
},
"spec": {
    "type": "VirtualMachine",
    "flavor": "cce.s2.small",
    "version": "v1.17.9-r0",
    "description": "this is a demo cluster",
    "ipv6enable": false,
    "hostNetwork": {
        "vpc": "23d3725f-6ffe-400e-8fb6-b4f9a7b3e8c1",
        "subnet": "c90b3ce5-e1f1-4c87-a006-644d78846438"
    },
    "containerNetwork": {
        "mode": "overlay_l2",
        "cidr": "172.16.0.0/16"
    },
    "eniNetwork": {},
    "authentication": {
        "mode": "rbac",
        "authenticatingProxy": {}
    },
    "billingMode": 0,
    "extendParam": {
        "clusterAZ": "multi_az"
    },
    "kubernetesSvcIpRange": "10.247.0.0/16",
    "kubeProxyMode": "iptables"
},
"status": {
    "phase": "Creating",
    "jobID": "d6bcbb0b-8529-11ea-8e34-0255ac101108"
}
}

Status Code

Table 23 <cce_02_0236__en-us_topic_0079614900_table46761928> describes the status code of this API.

Table 23 Status code
Status Code Description
201 The job for creating a cluster is successfully delivered.

For the description about error status codes, see Status Code <cce_02_0084>.