You can use an Alibaba Cloud account to call the DescribeSubaccountK8sClusterUserConfig operation to obtain the cluster kubeconfig file of a RAM user or RAM role.
Operation description
**
****Only Alibaba Cloud accounts can call this API operation.
Debugging
Authorization information
There is currently no authorization information disclosed in the API.
Request syntax
GET /k8s/{ClusterId}/users/{Uid}/user_config
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ClusterId | string | Yes | The cluster ID. | c5b5e80b0b64a4bf6939d2d8f**** |
Uid | string | Yes | The ID of the RAM user or RAM role whose cluster kubeconfig file that you want to obtain. | 26562443851650**** |
PrivateIpAddress | boolean | No | Specifies whether to obtain the kubeconfig file used to connect to the cluster over the internal network. Valid values:
Default value: | true |
TemporaryDurationMinutes | long | No | The validity period of the temporary kubeconfig file. Unit: minutes. Valid values: 15 to 4320 (three days). Note
If you leave this parameter empty, the system sets a longer validity period and returns the value in the expiration parameter of the response.
| 15 |
Response parameters
Examples
Sample success responses
JSON
format
{
"config": "apiVersion: v1****",
"expiration": "2024-03-10T09:56:17Z"
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|
No change history