# Download Kubeconfig

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

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

* [<mark style="color:blue;">Using configuration management tools</mark>](#using-configuration-management-tools)
* [<mark style="color:blue;">Using Kubernetes Manager</mark>](#using-kubernetes-manager)

### 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](https://1737632334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MifAzdGvKLDTtvJP8sm%2Fuploads%2Fgit-blob-6e218dab112d0719828bc3986feaffa8f84bc836%2Fdownload-kubeconfig-public-1.png?alt=media)

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>](https://docs.ionos.com/sections-test/guides/set-up-ionos-cloud/data-center-designer#inspector-pane).

![Download Kubeconfig file using the Inspector pane](https://1737632334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MifAzdGvKLDTtvJP8sm%2Fuploads%2Fgit-blob-eb696779f15195b372438149c70482488ebe42c9%2Fdownload-kubeconfig-public-2.png?alt=media)

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

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

* [<mark style="color:blue;">Using configuration management tools</mark>](#using-configuration-management-tools-1)
* [<mark style="color:blue;">Using Kubernetes Manager</mark>](#using-kubernetes-manager-1)

### 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](https://1737632334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MifAzdGvKLDTtvJP8sm%2Fuploads%2Fgit-blob-24268a0eff019192ee25e8cbe5daf7a64eef5585%2Fdownload-kubeconfig-private-1.png?alt=media)

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>](https://docs.ionos.com/sections-test/guides/set-up-ionos-cloud/data-center-designer#inspector-pane).

![Download Kubeconfig file using the Inspector pane](https://1737632334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MifAzdGvKLDTtvJP8sm%2Fuploads%2Fgit-blob-eb696779f15195b372438149c70482488ebe42c9%2Fdownload-kubeconfig-public-2.png?alt=media)

{% 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 %}
