> For the complete documentation index, see [llms.txt](https://docs.ionos.com/cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ionos.com/cloud/containers/managed-kubernetes/api-how-tos.md).

# API How-Tos

Managed Kubernetes API how-tos: access the Cloud API specification for Kubernetes cluster and node pool management on IONOS CLOUD.

All Kubernetes API instructions can be found in the main Cloud API specification file.

| [<mark style="color:blue;">**Cloud API - Open API Specification file**</mark>](https://docs.ionos.com/cloud/api-reference/cloud-api-v6/) |
| ---------------------------------------------------------------------------------------------------------------------------------------- |

To access the Kubernetes API, which the cluster provides, you can download the `kubeconfig` file and use it with tools such as `kubectl`.

| [<mark style="color:blue;">**Get Kubernetes Configuration Files**</mark>](https://docs.ionos.com/cloud/api-reference/cloud-api-v6/kubernetes/get-kubernetes-configuration-file) |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

## Quick Links

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><mark style="color:blue;"><strong>Set User Privileges</strong></mark></td><td>Learn how to set user privileges to create and manage Kubernetes cluster and node pools using the API.</td><td><a href="/cloud/containers/managed-kubernetes/api-how-tos/set-user-privileges.md">Set User Privileges</a></td></tr></tbody></table>

## Retrieve Kubernetes configuration files

<mark style="color:blue;">`GET`</mark> `https://api.ionos.com/cloudapi/v6/k8s/{k8sClusterId}/kubeconfig`

Retrieve a configuration file for the specified Kubernetes cluster, in YAML or JSON format as defined in the Accept header; the default Accept header is application/yaml.

#### Path Parameters

| Name                                           | Type   | Description                              |
| ---------------------------------------------- | ------ | ---------------------------------------- |
| k8sClusterId<mark style="color:red;">\*</mark> | String | The unique ID of the Kubernetes cluster. |

#### Query Parameters

| Name  | Type   | Description                                        |
| ----- | ------ | -------------------------------------------------- |
| depth | String | Controls the detail depth of the response objects. |

#### Headers

| Name              | Type    | Description                                                                                                    |
| ----------------- | ------- | -------------------------------------------------------------------------------------------------------------- |
| X-Contract-Number | Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. |

{% tabs %}
{% tab title="200: OK Successful operation" %}

```javascript
{}
```

{% endtab %}

{% tab title="400: Bad Request Any erroneous status code: 400 (parse error), 401 (auth error), 402 (trial access), 403 (insufficient privileges), 404 (not found), 405 (unsupported HTTP method), 415 (unsupported content type, 422 (validation error)), 429 (request rate limit exceeded), 500 (server error), or 503 (maintenance)." %}

```javascript
{
    "httpStatus": 400,
    "messages": {
        "errorCode": "123",
        "message": "Error message example."
    }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ionos.com/cloud/containers/managed-kubernetes/api-how-tos.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
