You need to enable JavaScript to run this app.
Volcengine Kubernetes Engine

Volcengine Kubernetes Engine

Copy page
Download PDF
Cluster management
CreateKubeconfig
Copy page
Download PDF
CreateKubeconfig
Generate the Kubeconfig credentials for a cluster.​
Usage instructions​
This is an asynchronous API. When this API returns a success message, it does not mean that the KubeConfig can be immediately used. You need to call the ListKubeconfigs API to obtain the text information of the KubeConfig, and attempt to use it after five seconds.​
Request description​
VKE has deployed services in multiple regions globally to provide a stable and low-latency access experience. You can refer to the Service addresses topic and select the most suitable access point for your business region.​
  • Request method: POST​
  • Request URL: https://vke.cn-beijing.volcengineapi.com?Action=CreateKubeconfig&Version=2022-05-12​
Debugging​
API Explorer
You can initiate calls online through API Explorer without paying attention to the signature generation process and quickly obtain the call results.
​
Request parameters​
The following table describes the API request parameters. You also need to provide public parameters when calling this API. See Public parameters for details.​
​
Parameters​
Type​
Required​
Sample value​
Description​
Action​
String​
Yes​
CreateKubeconfig​
The API name. The name of the current API is CreateKubeconfig.​
Version​
String​
Yes​
2022-05-12​
The API version. The current version of the API is 2022-05-12.​
ClusterId​
String​
Yes​
cc8oo0ivqt********​
Cluster ID.​
Cluster IDs can be queried by calling the ListClusters API.​
Warning​
The cluster must be in the {Running,[Ok]} or {Updating,[Progressing]} state. You can call the ListClusters API to obtain the current status of the cluster.​
Type​
String​
Yes​
Private​
The type of the cluster KubeConfig file. Valid values:​
  • Private: A Kubeconfig file for private access​
  • Public: A Kubeconfig file for public access​
ValidDuration​
Integer​
no​
43800​
The valid period of the KubeConfig file.​
  • Valid values: 1 to 867240.​
  • Unit: hours.​
  • Default value: 26280 (3 years).​
​
Sample requests​
​
POST /?Action=CreateKubeconfig&Version=2022-05-12 HTTP/1.1​
Content-Type:application/json​
{​
"ClusterId": "cc8oo0ivqt********",​
"Type": "Private",​
"ValidDuration": 867240​
}​
​
Response parameters​
The following table contains the response parameters of this API. See Response results for details about public response parameters.​
​
Parameters​
Type​
Sample value​
Description​
Id​
String​
kc5silum********​
Kubeconfig ID.​
Warning​
We recommend that you store the KubeConfig ID securely for future use.​
​
Sample responses​
​
HTTP/1.1 200 OK​
Content-Type:application/json​
{​
"ResponseMetadata": {​
"RequestId": "0216353********",​
"Action": "CreateKubeconfig",​
"Version": "2022-05-12",​
"Service": "vke",​
"Region": "cn-beijing"​
},​
"Result": {​
"Id": "kc5silum********"​
}​
}​
​
Error code​
The error codes for this API are listed in the table below. Refer to the Public error codes topic for details.​
​
HTTP status code​
Error code​
Error message​
Description​
400​
OperationDenied.ClusterStatus​
The action has been denied due to wrong cluster status {{statusPhase}} and [{{statusConditions}}].​
The current status of the specified cluster does not support this operation. Please confirm the required cluster status for this API and try again.​
400​
LimitExceeded.KubeconfigNumber​
You have reached the limit of the number of kubeconfig that you can create.​
The number of KubeConfig files that can be generated has reached the upper limit. For product limit descriptions, please refer to the Limit documentation.​
​
​
​
Last updated: 2026.03.31 10:58:12