> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nebius.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to create and modify Managed Service for Kubernetes® clusters

Managed Service for Kubernetes clusters manage and run containerized applications, providing automatic scaling, load balancing and streamlined deployment and management. In this guide, you will learn how to create, modify and delete clusters in Managed Service for Kubernetes.

For more information on managing node groups and adding them to clusters, see [Creating and modifying Managed Service for Kubernetes® node groups](../node-groups/manage).

## How to create clusters

<Tabs group="interfaces">
  <Tab title="Web console">
    1. In the sidebar, go to <Icon icon="https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/sidebar/compute.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=b91340217b08a1456d88ae0347f281d1" width="16" height="16" data-path="_assets/sidebar/compute.svg" /> **Compute** → **Kubernetes**.

    2. Click the <Icon icon="https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/plus.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=7c9efc69d65fc58db0eb73702fd81aa1" width="16" height="16" data-path="_assets/plus.svg" /> **Create cluster** button.

    3. On the page that opens, enter the cluster name.

    4. (Optionally) Enter labels in the `key:value` format.

    5. Review the **Control plane** section:

       * High availability is enabled by default. As a result, the cluster is created with three [etcd stores](../components#etcd) instead of one. This makes the cluster more reliable; data stored in etcd is accessible even in case of failures.

         If you want to have only one etcd store, disable the high availability option. However, the enabled option does not affect the cost of the cluster.

       * The Kubernetes version is set by default. For supported versions, see [Kubernetes® versions in Managed Service for Kubernetes](../versions).

       * A public endpoint is allocated by default. As a result, the cluster is available from the internet, you can connect to it from any machine.

         If you want to limit access to the cluster, disable the public endpoint option. Then, you can connect to the cluster only from a virtual machine located in the same subnet with the cluster.

    6. Review the **Network** section. The network and subnet are selected by default.

    7. Click **Create cluster**.
  </Tab>

  <Tab title="CLI">
    1. [Install](../../cli/install) and [configure](../../cli/configure) CLI for Nebius AI Cloud.
    2. Create a cluster:

       ```bash theme={null}
       nebius mk8s cluster create \
         --name <cluster_name> \
         --labels <key1=value1,key2=value2,...> \
         --control-plane-endpoints-public-endpoint=<true|false> \
         --control-plane-version 1.33 \
         --control-plane-subnet-id <subnet_ID> \
         --control-plane-etcd-cluster-size <number_of_etcd_stores>
       ```

       The command contains the following parameters:

       * `--name`: The cluster name.
       * `--labels`: Labels in the `key=value` format.
       * `--control-plane-endpoints-public-endpoint`: Enables a public endpoint. As a result, the cluster is available from the internet, one can connect to it from any machine.

         If you want to limit access to the cluster, set the parameter to `false`. Then, one can connect to the cluster only from a virtual machine located in the same subnet with the cluster.
       * `--control-plane-version`: The Kubernetes version. The default and recommended version is 1.32. For supported versions, see [Kubernetes® versions in Managed Service for Kubernetes](../versions).
       * `--control-plane-subnet-id`: The [subnet ID](../../vpc/networking/resources#how-to-get-a-subnet-id).
       * `--control-plane-etcd-cluster-size`: Number or [etcd stores](../components#etcd). If you do not specify the number, the cluster is created with three etcd stores. This ensures high availability and makes the cluster more reliable; data stored in etcd is accessible even in case of failures.

         You can specify a lower number. However, the enabled high availability does not affect the cost of the cluster.
  </Tab>

  <Tab title="Terraform">
    1. [Install and configure](/terraform-provider/quickstart) the Nebius AI Cloud provider for Terraform.

    2. Create the following configuration file:

       ```hcl theme={null}
       resource "nebius_mk8s_v1_cluster" "<cluster_name>" {
         name = "<cluster_name>"
         parent_id = "<project_ID>"
         labels = {
           <key1> = "<value1>"
           <key2> = "<value2>"
           ...
           <keyN> = "<valueN>"
         }
         control_plane = {
           endpoints = {
             public_endpoint = {}
           }
           version           = "1.32"
           subnet_id         = "<subnet_ID>"
           etcd_cluster_size = <number_of_etcd_stores>
         }
       }
       ```

       The file contains the following parameters:

       * `name`: The cluster name.
       * `parent_id`: [Project ID](/iam/manage-projects#terraform-3).
       * `labels`: Labels in the `key=value` format.
       * `control_plane`: Settings of the cluster's [control plane](../components#control-plane-components):

         * `endpoints.public_endpoint`: Its value `{}` enables a public endpoint. As a result, the cluster is available from the internet, you can connect to it from any machine.

           If you want to limit access to the cluster, delete the parameter. Then, one can connect to the cluster only from a virtual machine located in the same subnet with the cluster.
         * `version`: The Kubernetes version. The default and recommended version is 1.32. For supported versions, see [Kubernetes® versions in Managed Service for Kubernetes](../versions).
         * `subnet-id`: The [subnet ID](../../vpc/networking/resources#how-to-get-a-subnet-id).
         * `etcd_cluster_size`: Number or [etcd stores](/kubernetes/components#etcd). If you do not specify the number, the cluster is created with three etcd stores. This ensures high availability and makes the cluster more reliable; data stored in etcd is accessible even in case of failures.

           You can specify a lower number. However, the enabled high availability does not affect the cost of the cluster.

    3. Check that the configuration is correct:
       ```bash theme={null}
       terraform validate
       ```

    4. Apply the changes:
       ```bash theme={null}
       terraform apply
       ```
  </Tab>
</Tabs>

## How to modify clusters

<Tabs group="interfaces">
  <Tab title="CLI">
    1. Get the ID of the cluster via its name:

       ```bash theme={null}
       export NB_K8S_CLUSTER_ID=$(nebius mk8s cluster get-by-name \
         --name <cluster_name> --format json | jq -r '.metadata.id')
       ```

       Alternatively, you can use the listing command: <code>nebius mk8s cluster list</code>.

    2. Update the cluster settings:

       ```bash theme={null}
       nebius mk8s cluster update \
         --id $NB_K8S_CLUSTER_ID \
         --labels <key1=value1,key2=value2,...> \
         --control-plane-endpoints-public-endpoint=<true|false> \
         --control-plane-etcd-cluster-size <number_of_etcd_stores>
       ```

       The command contains the following parameters:

       * `--labels`: Labels in the `key=value` format.
       * `--control-plane-endpoints-public-endpoint`: Enables a public endpoint. As a result, the cluster is available from the internet, one can connect to it from any machine.

         If you want to limit access to the cluster, set the parameter to `false`. Then, one can connect to the cluster only from a virtual machine located in the same subnet with the cluster.
       * `--control-plane-etcd-cluster-size`: Number or [etcd stores](../components#etcd). Three of them ensure high availability of the cluster.

       Only the parameters from the command above can be changed. To perform a full cluster update, add `--full` to the command. This will update all parameters with the default values or the values specified in the `--full` command.
  </Tab>

  <Tab title="Terraform">
    1. Modify the manifest with the deployed infrastructure:

       ```hcl theme={null}
       resource "nebius_mk8s_v1_cluster" "<cluster_name>" {
         name = "<cluster_name>"
         labels = {
           <key1> = "<value1>"
           <key2> = "<value2>"
           ...
           <keyN> = "<valueN>"
         }
         control_plane = {
           endpoints = {
             public_endpoint = {}
           }
           etcd_cluster_size = <number_of_etcd_stores>
         }
       }
       ```

       You can change the following parameters:

       * `name`: The cluster name.
       * `labels`: Labels in the `key=value` format.
       * `control_plane`: Settings of the cluster's [control plane](../components#control-plane-components):

         * `endpoints.public_endpoint`: Its value `{}` enables a public endpoint. As a result, the cluster is available from the internet, you can connect to it from any machine.

           If you want to limit access to the cluster, delete the parameter. Then, one can connect to the cluster only from a virtual machine located in the same subnet with the cluster.
         * `etcd_cluster_size`: Number or [etcd stores](/kubernetes/components#etcd). If you do not specify the number, the cluster is created with three etcd stores. This ensures high availability and makes the cluster more reliable; data stored in etcd is accessible even in case of failures.

           You can specify a lower number. However, the enabled high availability does not affect the cost of the cluster.

    2. Check that the configuration is correct:
       ```bash theme={null}
       terraform validate
       ```

    3. Apply the changes:
       ```bash theme={null}
       terraform apply
       ```
  </Tab>
</Tabs>

## How to delete clusters

To delete a cluster, get its ID as shown in [How to modify clusters](#how-to-modify-clusters) and run the following command:

```bash theme={null}
nebius mk8s cluster delete --id $NB_K8S_CLUSTER_ID
```

## Examples

Creating a cluster with the Kubernetes version 1.32 and a public endpoint for the control plane:

```bash theme={null}
nebius mk8s cluster create \
  --name cluster-example \
  --control-plane-version 1.33 \
  --control-plane-subnet-id \
    $(nebius vpc subnet list --format json \
    | jq -r '.items[0].metadata.id') \
  --control-plane-endpoints-public-endpoint=true
```
