调用DescribeClusterUserKubeconfig返回包含当前登录用户身份信息的Kubernetes集群访问kubeconfig。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求头

该接口使用公共请求头,无特殊请求头。请参见公共请求参数文档。

请求语法

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

请求参数

名称 类型 是否必选 示例值 描述
ClusterId String c5b5e80b0b64a4bf6939d2d8fbbc5****

集群ID。

PrivateIpAddress Boolean true

当前用户对应的集群访问kubeconfig。

返回数据

名称 类型 示例值 描述
config String ****

返回数据。

示例

请求示例

GET /k8s/[ClusterId]/user_config HTTP/1.1
公共请求头
{
"ClusterId": "c5b5e80b0b64a4bf6939d2d8fbbc5****"
}

正常返回示例

XML 格式

<config>
apiVersion: v1
clusters:
- cluster:
    server: https://101.200.201.xxx:6443
    certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUQ2ekNDQXRPZ0F3SUJBZ0lERmFTRU1BMEdDU3FHU0liM0RRRUJDd1VBTUdveEtqQW9CZ05WQkFvVElXTTQKTW1VMk9UZzNaVEk1TmpFME5URXhPREpsWkdGalpEYzBabUZtWmpjMlpURVFNQTRHQTFVRUN4TUhaR1ZtWVhWcwpkREVxTUNnR0ExVUVBeE1oWXpneVpUWTVPRGRsTWprMk1UUTFNVEU0TW1Wa1lXTmtOelJtWVdabU56WmxNQjRYCkRUSXdNRE14TVRBek1ESXdNRm9YRFRRd01ETXdOakF6TURjME1Gb3dhakVxTUNnR0ExVUVDaE1oWXpneVpUWTUKT0RkbE1qazJNVFExTVRFNE1tVmtZV05rTnpSbVlXWm1OelpsTVJBd0RnWURWUVFMRXdka1pXWmhkV3gwTVNvdwpLQVlEVlFRREV5RmpPREpsTmprNE4yVXlPVFl4TkRVeE1UZ3laV1JoWTJRM05HWmhabVkzTm1Vd2dnRWlNQTBHCkNTcUdTSWIzRFFFQkFRVUFBNElCRHdBd2dnR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lZlYzhLdXprb1lxQVRUeGRDNTMKMGVyazE2djBOT201dnprYXFFY1BqVW9Uc250aXdTNjQyQ0FkaEJoRG00djZ1L2loUFBJWEZodXRqR0hNV3VoeQpSd3l0NHFMUjZBd1NGSFd6cXR3NEp4SEpPNzlkQmt2VDRDdnN4c202OTc1QURuSGZka1MzUi9NdFRtRWlUZ1E9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K
  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******UJNR0ExVUVDaE1NYzNsemRHVnQKT25WelpYSnpNUWt3QndZRFZRUUxFd0F4SkRBaUJnTlZCQU1UR3pFME5qUXpOelF3TnpJNU56UTRNREl0TVRVNApOREF3TVRNNE9EQ0JuekFOQmdrcWhraUc5dzBCQVFFRkFBT0JqUUF3Z1lrQ2dZRUExNWhkbUtlOUlPWXJTRTdBClhzajdXWWNXVmtTSzhBd1FheStrRXFuQWluTTZ6MVJZZ0JMc28vdEpFQlhvZDJ5RjZoLzAwcWdxc2duV241RzEKMERnSHNRTGRZZm9vQmZ4NmIwaDlqZ2tWanBQMTZYaytkY0w4N2Vwbkg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URSBLRVktLS0tLQo=
</config>

JSON 格式

{
    "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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