You can call DescribeClusterUserKubeconfig to obtain a kubeconfig file of a cluster. A kubeconfig file contains the details of the current user and is used to configure access to a cluster.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request headers

This operation uses the common request header only. For more information, see Common parameters.

Request syntax

GET /k8s/[ClusterId]/user_config HTTPS|HTTP

Request parameters

Parameter Type Required Example Description
ClusterId String Yes c5b5e80b0b64a4bf6939d2d8fbbc5****

The ID of the cluster.

PrivateIpAddress Boolean No true

Specifies whether to return the kubeconfig file that is used to access the cluster from the internal network.

Response parameters

Parameter Type Example Description
config String ****

The content of the kubeconfig file.

Examples

Sample requests

GET /k8s/[ClusterId]/user_config HTTP/1.1
Common request header
{
"ClusterId": "c5b5e80b0b64a4bf6939d2d8fbbc5****"
}

Sample success responses

XML format

<config>
apiVersion: v1
clusters:
- cluster:
    server: https://101.200.201.xxx:6443
    certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUQ2ekNDQXRPZ0F3SUJBZ0lERmFTRU1BMEdDU3FHU0liM0RRRUJDd1VBTUdveEtqQW9CZ05WQkFvVElXTTQKTW1VMk9UZzNaVEk1TmpFME5URXhPREpsWkdGalpEYzBabUZtWmpjMlpURVFNQTRHQTFVRUN4TUhaR1ZtWVhWcwpkREVxTUNnR0ExVUVBeE1oWXpneVpUWTVPRGRsTWprMk1UUTFNVEU0TW1Wa1lXTmtOelJtWVdabU56WmxNQjRYCkRUSXdNRE14TVRBek1ESXdNRm9YRFRRd01ETXdOakF6TURjME1Gb3dhakVxTUNnR0ExVUVDaE1oWXpneVpUWTUKT0RkbE1qazJNVFExTVRFNE1tVmtZV05rTnpSbVlXWm1OelpsTVJBd0RnWURWUVFMRXdka1pXWmhkV3gwTVNvdwpLQVlEVlFRREV5RmpPREpsTmprNE4yVXlPVFl4TkRVeE1UZ3laV1JoWTJRM05HWmhabVkzTm1V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ODBleWFwWCt4b25sZW92ODhrZG16bWs0MWpFTHNLVUNZbjEwVFlkRlZlYzhLdXprb1lxQVRUeGRDNTMKMGVyazE2djBOT201dnprYXFFY1BqVW9Uc250aXdTNjQyQ0FkaEJoRG00djZ1L2loUFBJWEZodXRqR0hNV3VoeQpSd3l0NHFMUjZBd1NGSFd6cXR3NEp4SEpPNzlkQmt2VDRDdnN4c202OTc1QURuSGZka1MzUi9NdFRtRWlUZ1E9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K
  name: kubernetes
contexts:
- context:
    cluster: kubernetes
    user: "kubernetes-admin"
  name: kubernetes-admin-c82e6987e2961451182edacd74faff76e
current-context: kubernetes-admin-c82e6987e2961451182edacd74faff76e
kind: Config
preferences: {}
users:
- name: "kubernetes-admin"
  user:
    client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURWekNDQWorZ0F3SUJBZ0lERmJMZk1BMEdDU3FHU0liM0RRRUJDd1VBTUdveEtqQW9CZ05WQkFvVElXTTQKTW1VMk9UZzNaVEk1TmpFME5URXhPREpsWkdGalpEYzBabUZtWmpjMlpURVFNQTRHQTFVRUN4TUhaR1ZtWVhWcwpkREVxTUNnR0ExVUVBeE1oWXpneVpUWTVPRGRsTWprMk1UUTFNVEU0TW1Wa1lXTmtOelJtWVdabU56WmxNQjRYCkRUSXdNRE14TWpBNE1UZ3dNRm9YRFRJek1ETXhNakE0TWp******UJNR0ExVUVDaE1NYzNsemRHVnQKT25WelpYSnpNUWt3QndZRFZRUUxFd0F4SkRBaUJnTlZCQU1UR3pFME5qUXpOelF3TnpJNU56UTRNREl0TVRVNApOREF3TVRNNE9EQ0JuekFOQmdrcWhraUc5dzBCQVFFRkFBT0JqUUF3Z1lrQ2dZRUExNWhkbUtlOUlPWXJTRTdBClhzajdXWWNXVmtTSzhBd1FheStrRXFuQWluTTZ6MVJZZ0JMc28vdEpFQlhvZDJ5RjZoLzAwcWdxc2duV241RzEKMERnSHN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bjZGdmU5RjNDczVQWVFDS3lBPQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo=
</config>

JSON format

{
    "config": "\napiVersion: v1\nclusters:\n- cluster:\n    server: https://101.200.201.xxx:6443\n    certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUQ2ekNDQXRPZ0F3SUJBZ0lERmFTRU1BMEdDU3FHU0liM0RRRUJDd1VBTUdveEtqQW9CZ05WQkFvVElXTTQKTW1VMk9UZzNaVEk1TmpFME5URXhPREpsWkdGalpEYzBabUZtWmpjMlpURVFNQTRHQTFVRUN4TUhaR1ZtWVhWcwpkREVxTUNnR0ExVUVBeE1oWXpneVpUWTVPRGRsTWprMk1UUTFNVEU0TW1Wa1lXTmtOelJtWVdabU56WmxNQjRYCkRUSXdNRE14TVRBek1ESXdNRm9YRFRRd01ETXdOakF6TURjME1Gb3dhakVxTUNnR0ExVUVDaE1oWXpneVpUWTUKT0RkbE1qazJNVFExTVRFNE1tVmtZV05rTnpSbVlXWm1OelpsTVJBd0RnWURWUVFMRXdka1pXWmhkV3gwTVNvdwpLQVlEVlFRREV5RmpPREpsTmprNE4yVXlPVFl4TkRVeE1UZ3laV1JoWTJRM05HWmhabVkzTm1Vd2dnRWlNQTBHCkNTcUdTSWIzRFFFQkFRVUFBNElCRHdBd2dnRUtBb0lCQVFETUtETHE4M2VJdFk5VDBDZkV4cmlncllDbi85RDQKc1c0UTVwN1I4Z2VoZ04rVGRYY1l1Z2*****AyZldDMUljTmhQYWNTRmQzd0Rzd3NnN2NTUUZ4K09WZWVTMgo1WWtOQjluSnduK2xQK3JMUW80aDBpWTNEL2laVXJLTFdlUVpNMmJIWVFKNUdSeC9CemRZYUo4Z0w4WHFmaDBvCjVOR3daWVVpdW5IUTNKYWkzaEZZNmlma3pHM3NSclFjaGNrVjVtRVpxU0tCQ0RQUkVXY2ZGM1R0cC9Pb283QkkKTEtkRG1FdWpVWFE4VVg1Y3A1ajZ3Wmw4RG1vQkxnM2JpTzBiay9aKzJZdGptd1loSjNiWXgxWUVUK1ZIdmZCbApremJ4Kzd0UmRERURoNjdNakFWV2dxMEVKaE1qVGVhNStjVHRwamRkbVl5QWhsRkswRzhiSkJqZkFnTUJBQUdqCmdaa3dnWll3RGdZRFZSMFBBUUgvQkFRREFnS3NNQThHQTFVZEV3RUIvd1FGTUFNQkFmOHdQQVlJS3dZQkJRVUgKQVFFRU1EQXVNQ3dHQ0NzR0FRVUZCekFCaGlCb2RIUndPaTh2WTJWeWRITXVZV056TG1Gc2FYbDFiaTVqYjIwdgpiMk56Y0RBMUJnTlZIUjhFTGpBc01DcWdLS0FtaGlSb2RIUndPaTh2WTJWeWRITXVZV056TG1Gc2FYbDFiaTVqCmIyMHZjbTl2ZEM1amNtd3dEUVlKS29aSWh2Y05BUUVMQlFBRGdnRUJBTGwwcXJWcDluZHlrdnNEUytmSENYM0gKSmk1M1pIVmhHK0Q4T1NmL0NFV2Y3Qm9XeFgrYXpYZ3hDNkUza3k4OEM3YWFlcjA2WDhhZ1Bsci93aFpMRHFYTApaUWpvZ1UzeGpTbXJZNTlJTXUva2N5NnFObVhKbjAzUTNoVHlwUjNxZVV2eFZiRE9LaEc5OHVFNEMrbXF6YjB2CllTTUZHODBleWFwWCt4b25sZW92ODhrZG16bWs0MWpFTHNLVUNZbjEwVFlkRlZlYzhLdXprb1lxQVRUeGRDNTMKMGVyazE2djBOT201dnprYXFFY1BqVW9Uc250aXdTNjQyQ0FkaEJoRG00djZ1L2loUFBJWEZodXRqR0hNV3VoeQpSd3l0NHFMUjZBd1NGSFd6cXR3NEp4SEpPNzlkQmt2VDRDdnN4c202OTc1QURuSGZka1MzUi9NdFRtRWlUZ1E9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K\n  name: kubernetes\ncontexts:\n- context:\n    cluster: kubernetes\n    user: \"kubernetes-admin\"\n  name: kubernetes-admin-c82e6987e2961451182edacd74faff76e\ncurrent-context: kubernetes-admin-c82e6987e2961451182edacd74faff76e\nkind: Config\npreferences: {}\nusers:\n- name: \"kubernetes-admin\"\n  user:\n    client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURWekNDQWorZ0F3SUJBZ0lERmJMZk1BMEdDU3FHU0liM0RRRUJDd1VBTUdveEtqQW9CZ05WQkFvVElXTTQKTW1VMk9UZzNaVEk1TmpFME5URXhPREpsWkdGalpEYzBabUZtWmpjMlpURVFNQTRHQTFVRUN4TUhaR1ZtWVhWcwpkREVxTUNnR0ExVUVBeE1oWXpneVpUWTVPRGRsTWprMk1UUTFNVEU0TW1Wa1lXTmtOelJtWVdabU56WmxNQjRYCkRUSXdNRE14TWpBNE1UZ3dNRm9YRFRJek1ETXhNakE0TWp******UJNR0ExVUVDaE1NYzNsemRHVnQKT25WelpYSnpNUWt3QndZRFZRUUxFd0F4SkRBaUJnTlZCQU1UR3pFME5qUXpOelF3TnpJNU56UTRNREl0TVRVNApOREF3TVRNNE9EQ0JuekFOQmdrcWhraUc5dzBCQVFFRkFBT0JqUUF3Z1lrQ2dZRUExNWhkbUtlOUlPWXJTRTdBClhzajdXWWNXVmtTSzhBd1FheStrRXFuQWluTTZ6MVJZZ0JMc28vdEpFQlhvZDJ5RjZoLzAwcWdxc2duV241RzEKMERnSHNRTGRZZm9vQmZ4NmIwaDlqZ2tWanBQMTZYaytkY0w4N2VwbkgyRVBGN25pVi9xb2NHRFZGcFNGcDI4SQpzckgyTGk4YW9mNlpsR2FGYkZCcG5ZTmtOUE1DQXdFQUFhT0JxekNCcURBT0JnTlZIUThCQWY4RUJBTUNCNEF3CkV3WURWUjBsQkF3d0NnWUlLd1lCQlFVSEF3SXdEQVlEVlIwVEFRSC9CQUl3QURBOEJnZ3JCZ0VGQlFjQkFRUXcKTUM0d0xBWUlLd1lCQlFVSE1BR0dJR2gwZEhBNkx5OWpaWEowY3k1aFkzTXVZV3hwZVhWdUxtTnZiUzl2WTNOdwpNRFVHQTFVZEh3UXVNQ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