Reading a Specified Cluster
Function
This API is used to obtain details about a specified cluster.
URI
GET /api/v3/projects/{project_id}/clusters/{cluster_id}
Table 1 describes the parameters of this API.
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. |
cluster_id | Yes | Cluster ID. For details about how to obtain the cluster ID, see How to Obtain Parameters in the API URI. |
Request
Request parameters:
Table 2 lists the request parameters.
Parameter | Mandatory | Description |
---|---|---|
Content-Type | Yes | Message body type (format). Possible values:
|
X-Auth-Token | Yes | 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 Obtaining a User Token. |
Example request:
N/A
Response
Response parameters:
Table 3 describes the 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 object | Cluster metadata, which is a collection of attributes. |
spec | spec object | Detailed description of the cluster targeted by this API. CCE creates or updates objects by defining or updating its spec. |
status | status object | Cluster status and jobID of the job that reads a specified cluster. |
Parameter | Type | Description |
---|---|---|
category | String | Cluster category:
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.
NOTE:
|
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
|
az | String | AZ of the cluster. |
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. |
supportIstio | String | Reserved. This parameter is not used in the current version. NOTE: This field is not supported for the current version. |
description | String | Cluster description. |
hostNetwork | hostNetwork 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 | containerNetwork object | Container network parameters, including a container network model and container CIDR block. |
eniNetwork | eniNetwork object | Configuration of Cloud Native Network 2.0. Specify this field when creating a CCE Turbo cluster. |
publicAccess | PublicAccess object | Cluster API access control. |
authentication | authentication 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 | No | MasterSpec objects Advanced configurations of the master node. |
extendParam | extendParam object | Extended fields in the format of key-value pairs. |
kubernetesSvcIpRange | String | Service CIDR block or the IP address range which the kubernetes clusterIp must fall within. |
kubeProxyMode | String | Service forwarding mode. Two modes are available:
|
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. NOTE: Currently, the VPC container network model does not support interconnection with VPCs that contain an extended CIDR block. If you are an enterprise user, ensure that the enterprise project ID of the VPC is the same as that selected during cluster creation. The enterprise project ID of the cluster is specified by enterpriseProjectId in the extendParam field. The default value is 0, indicating the default enterprise project. |
subnet | String | Network ID of the subnet. The value is obtained from Creating a VPC and Subnet. |
SecurityGroup | String | ID of the default security group created for the node during cluster creation. |
Parameter | Type | Description |
---|---|---|
mode | String | Container network model. Select one of the following possible values:
NOTE:
|
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 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. Minimum: 0 Maximum: 64 |
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. |
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 | Mandatory | Type | Description |
---|---|---|---|
availabilityZone | No | String | Availability Zone. |
Parameter | Type | Description |
---|---|---|
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 | CPU management policy of the master node. |
upgradefrom | String | Version from which this version is upgrade. |
enterpriseProjectId | String | ID of the enterprise project to which the cluster belongs. NOTE:
|
Parameter | Type | Description |
---|---|---|
phase | String | Cluster status. Possible values:
|
reason | String | Reason of cluster state transition. 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 | endpoint object | Access address of the kube-apiserver in the cluster. |
Parameter | Type | Description |
---|---|---|
internal | String | Internal network address. |
external | String | External network address. |
Response example:
"kind": "Cluster","apiVersion": "v3","metadata": {"name": "mycluster","uid": "365b5e05-846a-11ea-9fe6-0255ac101107","creationTimestamp": "2020-04-22 07:23:50.157883 +0000 UTC","updateTimestamp": "2020-05-08 03:10:12.174334 +0000 UTC"},"spec": {"type": "VirtualMachine","flavor": "cce.s1.small","version": "v1.17.9-r0","description": "new description","az": "ru-moscow-1a","ipv6enable": false,"supportIstio": true,"hostNetwork": {"vpc": "23d3725f-6ffe-400e-8fb6-b4f9a7b3e8c1","subnet": "c90b3ce5-e1f1-4c87-a006-644d78846438","SecurityGroup": "7bf2a95b-f41d-4187-9e72-d0a9a4de8e6d"},"containerNetwork": {"mode": "overlay_l2","cidr": "172.16.0.0/16"},"eniNetwork": {},"authentication": {"mode": "rbac","authenticatingProxy": {}},"billingMode": 0,"extendParam": {"alpha.cce/fixPoolMask": "","kubernetes.io/cpuManagerPolicy": "","upgradefrom": ""},"kubernetesSvcIpRange": "10.247.0.0/16","kubeProxyMode": "iptables"},"status": {"phase": "Available","endpoints": [{"Internal": "https://192.168.0.61:5443",},{"External": "https://10.185.69.54:5443",},{"external_sbc": "https://a140174a-2f3e-11e9-9f91-0255ac101405.cce.ru-moscow.hc.sbercloud.ru",},]}}
Status Code
Table 13 describes the status code of this API.
Status Code | Description |
---|---|
200 | Information about the specified cluster is successfully obtained. |
For details about error status codes, see Status Code.
- Function
- URI
- Request
- Response
- Status Code