# Download Kubeconfig

A `kubeconfig` file is used to configure access to Kubernetes.

{% tabs %}
{% tab title="Public Node Pools" %}
You can download the `kubeconfig` file:

### Using configuration management tools

You can download the `kubeconfig` file using configuration management tools such as [<mark style="color:blue;">IonosCTL CLI</mark>](https://docs.ionos.com/cli-ionosctl/subcommands/managed-kubernetes/kubeconfig/get), [<mark style="color:blue;">Ansible</mark>](https://docs.ionos.com/ansible/api/managed-kubernetes/modules/k8s_config), and [<mark style="color:blue;">Terraform</mark>](https://docs.ionos.com/terraform-provider/data-sources/k8s_cluster#example-of-dumping-the-kube_config-raw-data-into-a-yaml-file). Following are a few options to retrieve the `kubeconfig` files.

| **Tool**                                                                                                                                                                      | **Parameter Reference**   | **Description**                                                                                                                                                                                                                                                                                                                                                                                  |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [<mark style="color:blue;">IonosCTL CLI</mark>](https://docs.ionos.com/cli-ionosctl/subcommands/managed-kubernetes/kubeconfig/get)                                            | `K8s Cluster Id`          | <p>You can retrieve the <code>kubeconfig</code> file and save it using a single command from <strong>IonosCTL CLI</strong>. For more information, see <a href="https://docs.ionos.com/cli-ionosctl/subcommands/managed-kubernetes/kubeconfig/get#examples"><mark style="color:blue;">example</mark></a>.<br><br><code>ionosctl k8s kubeconfig get --cluster-id CLUSTER\_ID</code></p>            |
| [<mark style="color:blue;">Ansible</mark>](https://docs.ionos.com/ansible/api/managed-kubernetes/modules/k8s_config)                                                          | `k8s_cluster config_file` | <p>You can retrieve the <code>kubeconfig</code> by specifying the <code>kubeconfig</code> parameter in the <strong>Ansible YAML</strong> file.<br><br>For more information, see <a href="https://docs.ionos.com/ansible/api/managed-kubernetes/modules/k8s_config"><mark style="color:blue;">Kubernetes configuration</mark></a>.</p>                                                            |
| [<mark style="color:blue;">Terraform</mark>](https://docs.ionos.com/terraform-provider/data-sources/k8s_cluster#example-of-dumping-the-kube_config-raw-data-into-a-yaml-file) | `filename`                | <p>You can interact with the <code>kubeconfig</code> resources by providing proper configurations.<br><br>For more information, see <a href="https://docs.ionos.com/terraform-provider/data-sources/k8s_cluster#example-of-dumping-the-kube_config-raw-data-into-a-yaml-file"><mark style="color:blue;">Example of dumping the <code>kubeconfig</code> raw data into a yaml file</mark></a>.</p> |

{% hint style="info" %}
**Note:** If you do not want to use any tools like **IonosCTL CLI**, **Ansible**, or **Terraform**, you can retrieve the `kubeconfig` file directly from the [<mark style="color:blue;">Get Kubernetes Configuration File</mark>](https://api.ionos.com/docs/cloud/v6/#tag/Kubernetes/operation/k8sKubeconfigGet) API using tools like `cURL` or `Wget`.
{% endhint %}

### Using Kubernetes Manager

1. In the **DCD**, go to **Menu** > **Containers** > **Managed Kubernetes**.
2. In **Kubernetes Manager**, select a cluster from the cluster list.
3. In the **Cluster Settings** tab, select either **kubeconfig.yaml** or **kubeconfig.json** from the drop-down list to download the `kubeconfig` file.

![Download Kubeconfig file using the Kubernetes Manager](/files/tfWpp7Xd0v38Gk0gxi9m)

4. Alternatively, you can also select the Kubernetes element in the Workspace and download the `kubeconfig` file in the [<mark style="color:blue;">Inspector pane</mark>](/cloud/set-up-ionos-cloud/data-center-designer.md#inspector-pane).

![Download Kubeconfig file using the Inspector pane](/files/kTPZsQeyhDWnM5chM4so)

{% hint style="success" %}
**Result:** The `kubeconfig` file is successfully downloaded.
{% endhint %}
{% endtab %}

{% tab title="Private Node Pools" %}
You can download the `kubeconfig` file:

### Using configuration management tools

You can download the `kubeconfig` file using configuration management tools such as [<mark style="color:blue;">IonosCTL CLI</mark>](https://docs.ionos.com/cli-ionosctl/subcommands/managed-kubernetes/kubeconfig/get), [<mark style="color:blue;">Ansible</mark>](https://docs.ionos.com/ansible/api/managed-kubernetes/modules/k8s_config), and [<mark style="color:blue;">Terraform</mark>](https://docs.ionos.com/terraform-provider/data-sources/k8s_cluster#example-of-dumping-the-kube_config-raw-data-into-a-yaml-file). Following are a few options to retrieve the `kubeconfig` files.

| **Tool**                                                                                                                                                                      | **Parameter Reference**   | **Description**                                                                                                                                                                                                                                                                                                                                                                                  |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [<mark style="color:blue;">IonosCTL CLI</mark>](https://docs.ionos.com/cli-ionosctl/subcommands/managed-kubernetes/kubeconfig/get)                                            | `K8s Cluster Id`          | <p>You can retrieve the <code>kubeconfig</code> file and save it using a single command from <strong>IonosCTL CLI</strong>. For more information, see <a href="https://docs.ionos.com/cli-ionosctl/subcommands/managed-kubernetes/kubeconfig/get#examples"><mark style="color:blue;">example</mark></a>.<br><br><code>ionosctl k8s kubeconfig get --cluster-id CLUSTER\_ID</code></p>            |
| [<mark style="color:blue;">Ansible</mark>](https://docs.ionos.com/ansible/api/managed-kubernetes/modules/k8s_config)                                                          | `k8s_cluster config_file` | <p>You can retrieve the <code>kubeconfig</code> by specifying the <code>kubeconfig</code> parameter in the <strong>Ansible YAML</strong> file.<br><br>For more information, see <a href="https://docs.ionos.com/ansible/api/managed-kubernetes/modules/k8s_config"><mark style="color:blue;">Kubernetes configuration</mark></a>.</p>                                                            |
| [<mark style="color:blue;">Terraform</mark>](https://docs.ionos.com/terraform-provider/data-sources/k8s_cluster#example-of-dumping-the-kube_config-raw-data-into-a-yaml-file) | `filename`                | <p>You can interact with the <code>kubeconfig</code> resources by providing proper configurations.<br><br>For more information, see <a href="https://docs.ionos.com/terraform-provider/data-sources/k8s_cluster#example-of-dumping-the-kube_config-raw-data-into-a-yaml-file"><mark style="color:blue;">Example of dumping the <code>kubeconfig</code> raw data into a yaml file</mark></a>.</p> |

{% hint style="info" %}
**Note:** If you do not want to use any tools like **IonosCTL CLI**, **Ansible**, or **Terraform**, you can retrieve the `kubeconfig` file directly from the [<mark style="color:blue;">Get Kubernetes Configuration File</mark>](https://api.ionos.com/docs/cloud/v6/#tag/Kubernetes/operation/k8sKubeconfigGet) API using tools like `cURL` or `Wget`.
{% endhint %}

### Using Kubernetes Manager

To download the `kubeconfig` file using Kubernetes Manager, follow these steps:

1. In the **DCD**, go to **Menu** > **Containers** > **Managed Kubernetes**.
2. In **Kubernetes Manager**, select a cluster from the cluster list.
3. In the **Cluster Settings** tab, select either **kubeconfig.yaml** or **kubeconfig.json** from the drop-down list to download the `kubeconfig` file.

![Download Kubeconfig file using the Kubernetes Manager](/files/zQWQspWWhkLc6e7GGFry)

4. Alternatively, you can also select the Kubernetes element in the Workspace and download the `kubeconfig` file in the [<mark style="color:blue;">Inspector pane</mark>](/cloud/set-up-ionos-cloud/data-center-designer.md#inspector-pane).

![Download Kubeconfig file using the Inspector pane](/files/kTPZsQeyhDWnM5chM4so)

{% hint style="success" %}
**Result:** The `kubeconfig` file is successfully downloaded.
{% endhint %}
{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Note**: Only **administrators** can retrieve the `kubeconfig` file without a node pool. All other users need to create a node pool first.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ionos.com/cloud/containers/managed-kubernetes/how-tos/download-kubeconfig-file.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
