# Set Up a Kubernetes Cluster

{% hint style="info" %}
**Prerequisite:** Only contract administrators, owners, and users with **Create Kubernetes Clusters** permission can create a cluster for Public and Private Node Pools. Other user types have **read-only** access.
{% endhint %}

{% tabs %}
{% tab title="Public Node Pools" %}
You can create a cluster using the **Kubernetes Manager** in [<mark style="color:blue;">DCD</mark>](https://docs.ionos.com/cloud/support/general-information/glossary-of-terms#data-center-designer-dcd) for Public Node Pools.

{% hint style="info" %}
**Note:**

* A total of **500 node pools** per cluster are supported.
* It is not possible to switch the **Node pool type** from **public to private** and vice versa.
  {% endhint %}

1. In the **DCD**, go to **Menu** > **Containers** > **Managed Kubernetes**.
2. Select **+ Create Cluster**.
3. Enter a **Name** for the cluster.

{% hint style="info" %}
**Note:** Ensure to use the following naming convention for the Kubernetes cluster:

* Can be a maximum of 63 characters in length.
* Begins and ends with an alphanumeric character: `a-z0-9A-Z`.
* Must not contain spaces or any other white-space characters.
* Can contain dashes (-), underscores (\_), and dots (.) in between.
  {% endhint %}

4. Select the Kubernetes **Version** you want to run in the cluster from the drop-down list.
5. Select a **Region** from the drop-down list.
6. In the **Node pool type** field, choose **Public** from the drop-down list.
7. Click **+ Create Cluster**.

![Accessing the Create Cluster modal](https://1737632334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MifAzdGvKLDTtvJP8sm%2Fuploads%2Fgit-blob-c7b679b6bf371208661f39ce20610d584f858c81%2Fset-up-akubernetes-cluster-1.png?alt=media)

{% hint style="success" %}
**Result:** A cluster is successfully created and listed in the clusters list for Public Node Pools. The cluster can be modified and populated with node pools once its status is **active**.
{% endhint %}
{% endtab %}

{% tab title="Private Node Pools" %}
You can create a cluster using the **Kubernetes Manager** in [<mark style="color:blue;">DCD</mark>](https://docs.ionos.com/cloud/support/general-information/glossary-of-terms#data-center-designer-dcd) for Private Node Pools. For this cluster, you have to provide a Gateway IP. It is the IP address assigned to the deployed Network Address Translation (NAT) Gateway. To reserve an IPv4 address, in the **DCD** go to **Menu** > **Network Services** > **IP Management**.

{% hint style="info" %}
**Note:**

* When defining a private node pool, you need to provide a data center in the **same location** as the cluster for which you create the node pool.
* A total of **500 node pools** per cluster are supported.
* It is not possible to switch the **Node pool type** from **private to public** and vice versa.
  {% endhint %}

To create a cluster for Private Node Pools in Kubernetes Manager, follow these steps:

1. In the **DCD**, go to **Menu** > **Containers** > **Managed Kubernetes**.
2. Select **+ Create Cluster**.
3. Enter a **Name** for the cluster.

{% hint style="info" %}
**Note:** Ensure to use the following naming convention for the Kubernetes cluster:

* Can be a maximum of 63 characters in length.
* Begins and ends with an alphanumeric character: `a-z0-9A-Z`.
* Must not contain spaces or any other white-space characters.
* Can contain dashes (-), underscores (\_), and dots (.) in between.
  {% endhint %}

4. Select the Kubernetes **Version** you want to run in the cluster from the drop-down list.
5. In the **Node pool type** field, choose **Private** from the drop-down list.
6. Select a **Region** from the drop-down list.

{% hint style="info" %}
**Note:** You can only create the cluster for Private Node Pools in the [<mark style="color:blue;">Virtual Data Centers (VDCs)</mark>](https://docs.ionos.com/cloud/support/general-information/glossary-of-terms#virtual-data-center-vdc) in the same region as the cluster.
{% endhint %}

7. Select a reserved IP address from the drop-down list in **Gateway IP**. To do this, you need to reserve an IPv4 address assigned by IONOS Cloud. For more information, see [<mark style="color:blue;">Reserve an IPv4 Address</mark>](https://docs.ionos.com/sections-test/guides/network-services/vdc-networking/ip-address/ipv4/how-tos/reserve-ipv4).
8. (*Optional*) Define a **Subnet** for the private LAN. This has to be an address of a **prefix length /16** in the Classless Inter-Domain Routing (CIDR) block.

{% hint style="info" %}
**Note:**

* The subnet value cannot intersect with the cluster's networks for pods and services. For clusters created with:
  * Kubernetes version 1.30 and above, the networks are `100.96.0.0/12` and `100.64.0.0/18`.
  * Older Kubernetes versions, the networks are `10.208.0.0/12` and `10.233.0.0/18`.
* Once provisioned, the **Region**, **Gateway IP**, and **Subnet** values cannot be changed.
  {% endhint %}

9. Click **+ Create Cluster**.

![Creating a cluster for a private node pool](https://1737632334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MifAzdGvKLDTtvJP8sm%2Fuploads%2Fgit-blob-4c3bb8f189710c895bab2ffbbab7173b9bd92b76%2Fset-up-akubernetes-cluster-2.png?alt=media)

{% hint style="success" %}
**Result:** A cluster is successfully created and listed in the clusters list for Private Node Pools.
{% endhint %}
{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Note:**

* To access the Kubernetes API provided by the cluster, download the `kubeconfig` file and use it with tools such as `kubectl`.
* The maintenance window starts at the time of your choosing and remains open for another four hours. All planned maintenance work will be performed within this window, however, not necessarily at the beginning.
  {% endhint %}
