• Cloud Container Engine

cce
  1. Help Center
  2. Cloud Container Engine
  3. API Reference
  4. Cluster and Host Management (Proprietary APIs)
  5. Obtaining Certificates for Accessing a Container Cluster

Obtaining Certificates for Accessing a Container Cluster

Function

This API is used to obtain the certificates cacrtclientcrt, and clientkey that kubectl (a Kubernetes command-line tool) requires to access a container cluster.

For the method about how to use kubectl to access a container cluster, see Using kubectl to Access a Container Cluster.

URI

GET /api/v1/clusters/{clusteruuid}/certificates

Table 1 describes the request parameters.

Table 1 Parameter description

Parameter

Mandatory

Description

clusteruuid

Yes

Cluster UUID.

Request

N/A

Response

Table 2 Data structure of the certificates field

Parameter

Type

Description

cluster_uuid

String

Cluster UUID.

cluster_name

String

Cluster Name.

endpoint

String

Access address of the container cluster.

external_endpoint

String

Address used to access the container cluster through the external network. If the cluster is not bound to an EIP, this parameter is invalid.

cacrt

String

String value of k8s cluster's cacrt.

clientcrt

String

String value of k8s cluster's clientcrt.

clientkey

String

String value of k8s cluster's clientkey.

Example response:
{
  "cluster_uuid": " d177c389-b1c4-4b5e-8031-906ff2389a49", 
  "cluster_name": "cluster-test",
  "endpoint": "https://192.168.0.2:5443",
  "external_endpoint": "https://172.20.50.188:5443",
  "cacrt": "xxxxxxxxxxxxxx",
  "clientcrt": "xxxxxxxxxxxxxx", 
  "clientkey": "xxxxxxxxxxxxxxx"
}
NOTE:

xxxxxxx indicates the content of the cacrtclientcrt, and clientkey certificates.

Status Code

Table 3 describes the status code of this API.

Table 3 Status code

Status Code

Description

200

This operation succeeds, and certificates for accessing a container cluster and information about the cluster is obtained.

For the description about status codes, see section Status Codes.