Skip to content

Download Cluster kubeconfig

GET
/api/v1/kubernetes/cluster-config-download/{service_id}/
curl --request GET \
--url 'https://api.e2enetworks.com/myaccount/api/v1/kubernetes/cluster-config-download/{service_id}/?project_id=<PROJECT_ID>&apikey=<API_KEY>&location=<LOCATION>' \
--header 'Authorization: Bearer <API_TOKEN>'

Returns the cluster’s kubeconfig file - the credentials and endpoint used by kubectl and other clients to connect to the cluster’s API server. Save the response as your ~/.kube/config (or merge it in). Use the cluster service_id.

service_id
required
integer

The cluster service_id, as returned by List.

Example

12345
project_id
required
integer

Identifier of the project to scope the request to. Required integer project ID.

Example

<PROJECT_ID>
apikey
required
string

API key used to authenticate the request.

Example

<API_KEY>
location
required
string

Region of the cluster.

Example

<LOCATION>

Successful response

Media typeapplication/json

The cluster’s kubeconfig, returned as YAML text (fields vary by cluster).

object
code
integer
data

The kubeconfig file contents.

string
errors
object
message
string

Example

{
"code": 200,
"data": "apiVersion: v1\nclusters:\n- cluster:\n server: https://203.0.113.10:6443\n name: my-k8s-cluster\ncontexts:\n- context:\n cluster: my-k8s-cluster\n user: admin-user\n name: my-k8s-cluster\ncurrent-context: my-k8s-cluster\nkind: Config\nusers:\n- name: admin-user\n user:\n token: <token>\n",
"message": "Success"
}