---
title: "Managed Kubernetes: Quick Start"
sidebar_label: "Quick start"
sidebar_position: 2
description: "How to get started with Managed Kubernetes: create a cluster, connect to it, and set up Ingress"
toc_max_heading_level: 2
---

import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import {TabItemLabel} from 'docs-kit/components'
import Formbricks from '@theme/MDXComponents/Formbricks'
import InstallEnvoyGatewayViaPanel from '@site/i18n/en/docusaurus-plugin-content-docs/current/_partials/managed-kubernetes/install-envoy-gateway-via-panel.mdx'
import InstallEnvoyGatewayViaHelm from '@site/i18n/en/docusaurus-plugin-content-docs/current/_partials/managed-kubernetes/install-envoy-gateway-via-helm.mdx'

# Managed Kubernetes: Quick Start

You can work with a Managed Kubernetes cluster in the [control panel](https://my.selectel.ru/mks/), via the [Managed Kubernetes API](/api/managed-kubernetes/), or [Terraform](/terraform/providers/).

1. [Create a cluster on a cloud server in the control panel](#create-cluster-in-control-panel).
2. [Connect to the cluster](#connect-to-cluster).
3. [Install Envoy Gateway](#install-envoy-gateway).

Learn more about infrastructure planning and application deployment in Managed Kubernetes in the [Cloud-native in Kubernetes](https://selectel.ru/blog/tutorials/cloud-native-in-kubernetes/) blog post.

## 1. Create a cluster on a cloud server in the control panel \{#create-cluster-in-control-panel}

1. [Configure a cluster on a cloud server](#configure-cluster).
2. [Configure a node group](#configure-node-group).
3. [Configure automation](#configure-automation).

### 1. Configure a cluster on a cloud server \{#configure-cluster}

1. In the [Control panel](https://my.selectel.ru/mks/), on the top menu, click **Products** and select **Managed Kubernetes**.

2. In the **Clusters** section, click **Create cluster**.

3. Enter a cluster name. The name will be displayed in cluster object names: node groups, nodes, load balancers, networks, and disks. For example, if the cluster name is `kelsie`, the node group name will be `kelsie-node-gdc8q`, and the boot disk name will be `kelsie-node-gdc8q-volume`.

4. Select a [location](/infrastructure/locations.mdx#pool) where the master nodes will be located. You cannot change the location after creating the cluster.

5. Select a [Kubernetes version](/managed-kubernetes/about/about-managed-kubernetes.mdx#versions). You can [upgrade the Kubernetes version](/managed-kubernetes/clusters/upgrade-version.mdx) after creating the cluster.

6. Optional: select a network plugin (CNI). Calico is used in the cluster by default. You cannot change the CNI after the cluster is created.

   In the Cilium network plugin, the following are enabled by default:

   * the `envoy daemonset` setting is enabled – for more details, see the [Envoy](https://docs.cilium.io/en/latest/security/network/proxy/envoy/#envoy) section in the Cilium documentation;
   * the `hubble-relay` setting is disabled – for more details, see the [Hubble Relay](https://docs.cilium.io/en/stable/internals/hubble/#hubble-relay) subsection of the Hubble internals article in the Cilium documentation.

   If you want to change these settings, create a cluster using the [Managed Kubernetes API](/api/managed-kubernetes/). Note that to use the `hubble-relay` setting, a node must have at least 4 GB of RAM.

7. Select a [cluster type](/managed-kubernetes/about/about-managed-kubernetes.mdx#cluster-types). You cannot change the cluster type after creating the cluster.

8. Optional: to make the cluster accessible via a private network and inaccessible from the Internet, check the **Private kube API** checkbox. By default, the cluster is created in a public network and is automatically assigned a public kube API IP address, which is accessible from the Internet. You cannot change the kube API access type after creating the cluster.

9. Click **Continue**.

### 2. Configure a node group \{#configure-node-group}

1. In the **Server type** field, select **Cloud server**.

2. Select a [location](/infrastructure/locations.mdx#pool) where all worker nodes in the group will be located. You cannot change the location after creating the cluster.

3. Configure the worker node group settings:

   3.1. Click **Select configuration** and choose the worker node configuration in the group:

   * [custom](/managed-kubernetes/node-groups/configurations.mdx#custom-configurations) — you can specify any resource ratio;
   * or [fixed with GPU](/managed-kubernetes/node-groups/configurations.mdx#fixed-configurations-with-gpu) — prebuilt node configurations with GPUs and a specified resource ratio.

   If standard configurations do not fit your needs, you can [add a node group with a fixed cloud server configuration](/managed-kubernetes/node-groups/create-node-group.mdx#add-node-group-with-cloud-nodes) via the Managed Kubernetes API or Terraform.

   3.2. If you have selected a custom configuration, specify the number of vCPUs, RAM, and select a [boot disk](/managed-kubernetes/volumes/about-volumes.mdx#boot-volumes). Specify the disk size.

   3.3. If you have selected a fixed configuration with GPU, select a prebuilt node configuration with GPUs, a [boot disk](/managed-kubernetes/volumes/about-volumes.mdx#boot-volumes), and specify the disk size. To [install GPU drivers manually](/managed-kubernetes/node-groups/gpu-drivers.mdx#install-gpu-drivers), turn off the **GPU drivers** switch. By default, the **GPU drivers** switch is turned on, and the cluster uses preinstalled drivers.

   3.4. Click **Save**.

4. Configure the number of worker nodes. For fault-tolerant operation of system components and the Cilium network plugin, we recommend having at least two worker nodes in the cluster, which can be in different groups:

   4.1. To have a fixed number of nodes in a node group, open the **Fixed** tab and specify the number of nodes.

   4.2. To use [autoscaling with Cluster Autoscaler](/managed-kubernetes/node-groups/autoscaling.mdx#autoscaling-with-cluster-autoscaler) in a node group, open the **With autoscaling** tab and set the minimum and maximum number of nodes in the group; the number of nodes will only change within this range. Autoscaling is not available for GPU node groups without drivers.

5. Optional: to make a node group [preemptible](/managed-kubernetes/node-groups/preemptible-node-groups.mdx), check the **Preemptible node group** checkbox. Preemptible node groups are available in the St. Petersburg, Moscow, and Novosibirsk [regions](/infrastructure/locations.mdx#region).

6. Optional: add node group labels:

   6.1. In the **Tags** field, click **Add**.

   6.2. Enter the label key.

   6.3. Enter the label value.

   6.4. Click **Add**.

7. Optional: add node group taints:

   7.1. In the **Taints** field, click **Add**.

   7.2. Enter the taint key.

   7.3. Enter the taint value.

   7.4. Select the effect:

   * NoSchedule — new pods will not be scheduled, and existing ones will continue to run;
   * PreferNoSchedule — new pods will be scheduled if there is no other capacity in the cluster;
   * NoExecute — running pods without corresponding tolerations will be evicted.

   7.5. Click **Add**.

8. Optional: add a script with custom parameters to configure the Managed Kubernetes cluster:

   8.1. In the **User data** field, click **Add**.

   8.2. Paste the script. The maximum size of a script containing non-Base64-encoded data is 47 KB. You can find script examples and supported formats in the [User data](/managed-kubernetes/node-groups/user-data.mdx)[ guide](/managed-kubernetes/node-groups/user-data.mdx).

9. Optional: to add an additional worker node group to the cluster, click **Add node group**. You can create a cluster with worker node groups in different segments of the same pool. This will improve fault tolerance and help maintain application availability if a failure occurs in one of the segments.

10. In the **Cloud network** block, configure a private subnet without internet access to group all cluster nodes.

    10.1. To create a private subnet, in the **Subnet for nodes** field, select **New private subnet**.

    A private network `<cluster_name>-network`, a private subnet, and a `<cluster_name>-router` router will be created automatically, where `<cluster_name>` is the cluster name. The CIDR is assigned automatically.

    The [default security group](/cloud-servers/security-groups/about-security-groups.mdx#default-security-group) will be assigned to node ports. Do not change its rules and do not assign a different security group. This will help avoid cluster operation failures.

    10.2. If a private subnet has already been created, in the **Subnet for nodes** field, select an existing subnet. The subnet must meet the following conditions:

    * belongs to the network of the project in which you are creating the cluster. You can check which project a network belongs to in the [Control panel](https://my.selectel.ru/vpc/default/networks/): on the top menu, click **Products** → **Managed Kubernetes** → **Network** → **Private networks** tab → network card. If the network belongs to a different project, the network card will have a **Cross-project** tag and information about the ID of the project in which it was created;
    * [connected to a cloud router](/cloud-servers/cloud-networks/cloud-routers.mdx#connect-private-subnet-to-cloud-router);
    * does not overlap with the `10.10.0.0/16`, `10.96.0.0/12`, `10.250.0.0/16`, and `10.251.0.0/24` ranges. These ranges are used for Managed Kubernetes internal addressing;
    * [DHCP is disabled](/cloud-servers/cloud-networks/private-networks-and-subnets.mdx#disable-dhcp-in-private-subnet);
    * only the [default security group](/cloud-servers/security-groups/about-security-groups.mdx#default-security-group) is assigned to the ports. Do not change its rules and do not assign a different security group. This will help avoid cluster operation failures. You can [view security groups on ports](/cloud-servers/security-groups/manage-groups/view-security-groups-on-ports.mdx#view-security-groups-on-port).

11. Click **Continue**.

### 3. Configure automation \{#configure-automation}

1. Optional: to enable [node auto-recovery](/managed-kubernetes/node-groups/reinstall-nodes.mdx), check the **Node auto-recovery** checkbox. If the cluster has only one worker node, auto-recovery is not available.

2. Optional: to enable [automatic patch version updates](/managed-kubernetes/clusters/upgrade-version.mdx), check the **Automatic patch version updates** checkbox. If the cluster has only one master node (a base cluster) or only one worker node, automatic Kubernetes patch version updates are not available.

3. Select the [maintenance start time](/managed-kubernetes/clusters/set-up-maintenance-window.mdx) for the cluster — the time when automatic cluster maintenance actions will begin.

4. Optional: to enable [audit logs](/managed-kubernetes/clusters/logs.mdx), check the **Audit logs** checkbox. After creating the cluster, [configure integration with a log storage and analysis system](/managed-kubernetes/clusters/logs#configure-export-of-audit-logs).

5. Check the price of the cluster on a cloud server.

6. Click **Create**. Creating a cluster takes a few minutes; during this time, the cluster will have the [CREATING](/managed-kubernetes/clusters/cluster-statuses.mdx) status. The cluster will be ready to use when it enters the `ACTIVE` status.

## 2. Connect to the cluster \{#connect-to-cluster}

To start working with the cluster, you need to configure [kubectl](https://kubernetes.io/docs/reference/kubectl/kubectl/).

:::info

We recommend performing all actions with cluster nodes, load balancers, and volumes only via kubectl.

:::

After [updating the certificates for system components](/managed-kubernetes/clusters/update-certificate.mdx), you must reconnect to the cluster.

<Tabs queryString="connect-to-cluster">
  <TabItem value="Linux" default>
    <TabItemLabel>
      Linux
    </TabItemLabel>

    1. Install the Kubernetes console client, kubectl, according to the [official instructions](https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/).
    2. In the [Control panel](https://my.selectel.ru/mks/), on the top menu, click **Products** and select **Managed Kubernetes**.
    3. In the **Clusters** section, open the cluster page → **Settings** tab.
    4. If you are using a private kube API, check access to it. The IP address is specified in the **Kube API \*\*\*\* field**.
    5. Click **Download kubeconfig**. Downloading the kubeconfig file is not available if the cluster status is `PENDING_CREATE`, `PENDING_ROTATE_CERTS`, `PENDING_DELETE`, or `ERROR`.
    6. Export the path to the kubeconfig file to the `KUBECONFIG` environment variable:

       ```bash
       export KUBECONFIG=<path>
       ```

       Specify `<path>` — the path to the `cluster_name.yaml` kubeconfig file.
    7. Check that the setup is correct — connect to the cluster via kubectl:

       ```bash
       kubectl get nodes
       ```

       Nodes must be in the `Ready`` status`.
  </TabItem>

  <TabItem value="windows">
    <TabItemLabel>
      Windows
    </TabItemLabel>

    1. Install the Kubernetes console client, kubectl, according to the [official instructions](https://kubernetes.io/docs/tasks/tools/install-kubectl-windows/).
    2. In the [Control panel](https://my.selectel.ru/mks/), on the top menu, click **Products** and select **Managed Kubernetes**.
    3. In the **Clusters** section, open the cluster page → **Settings** tab.
    4. If you are using a private kube API, check access to it. The IP address is specified in the **Kube API \*\*\*\* field**.
    5. Click **Download kubeconfig**. Downloading the kubeconfig file is not available if the cluster status is `PENDING_CREATE`, `PENDING_ROTATE_CERTS`, `PENDING_DELETE`, or `ERROR`.
    6. Run PowerShell as an administrator.
    7. Export the path to the kubeconfig file to the `KUBECONFIG` environment variable:

       ```bash
       $env:KUBECONFIG = <path>
       ```

       Specify `<path>` — the path to the `cluster_name.yaml` kubeconfig file.
    8. Check that the setup is correct — connect to the cluster via kubectl:

       ```bash
       kubectl get nodes
       ```

       Nodes must be in the `Ready`` status`.
  </TabItem>
</Tabs>

## 3. Install Envoy Gateway \{#install-envoy-gateway}

<Tabs queryString="install-application">
  <TabItem value="panel" default>
    <TabItemLabel>
      Control panel
    </TabItemLabel>

    <InstallEnvoyGatewayViaPanel />
  </TabItem>

  <TabItem value="helm">
    <TabItemLabel>
      Helm
    </TabItemLabel>

    <InstallEnvoyGatewayViaHelm />
  </TabItem>
</Tabs>

<Formbricks />
