Get a Kubernetes cluster's kubeconfig

Get a kubeconfig with admin access to the cluster. You can get it as often as you need. The kubeconfig verifies the API's certificate with the cluster's CA. When the cluster's CA isn't available, the kubeconfig skips the certificate check.

GET https://{availability_zone}.betterstackcloud.com/v1/kubernetes-clusters/{id}/kubeconfig
id string required

The ID of the Kubernetes cluster.

Authorization string required

Bearer $TOKEN

200 OK
{
  "kubeconfig": "example",
  "server": "example",
  "rotated_at": "2026-07-01T12:00:00.000Z"
}

Returns a JSON object with the kubeconfig and the API URL.

kubeconfig string

The kubeconfig, as YAML with the admin token. Save this value as your kubeconfig file.

server string

The HTTPS URL of the Kubernetes API, on port 6443.

rotated_at datetime or null

When the admin token was first issued or last rotated, or null. In ISO 8601 format, such as 2026-07-01T12:00:00Z.