Generate a kubeconfig
import requests
url = "https://platform.ankra.app/api/v1/clusters/{cluster_id}/kubeconfig"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/clusters/{cluster_id}/kubeconfig', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/clusters/{cluster_id}/kubeconfig \
--header 'Authorization: Bearer <token>'{
"expires_at": "2023-11-07T05:31:56Z",
"kubeconfig": "<string>",
"server": "<string>"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Cluster Access
Generate a kubeconfig
Returns a ready-to-use kubeconfig document for the cluster that points at the kube gateway and embeds a freshly minted short-lived token, together with the server URL and the token’s expiry. Requires kube_access.use on the cluster; requests are rate limited per user (429).
POST
/
api
/
v1
/
clusters
/
{cluster_id}
/
kubeconfig
Generate a kubeconfig
import requests
url = "https://platform.ankra.app/api/v1/clusters/{cluster_id}/kubeconfig"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/clusters/{cluster_id}/kubeconfig', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/clusters/{cluster_id}/kubeconfig \
--header 'Authorization: Bearer <token>'{
"expires_at": "2023-11-07T05:31:56Z",
"kubeconfig": "<string>",
"server": "<string>"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.