Skip to main content
With Kubernetes, you can efficiently manage and scale your containerized ML/AI applications and ensure they are portable and fault-tolerant. This guide will help you get started with Managed Service for Kubernetes, a service provided by Nebius AI Cloud. You will learn how to set up your environment for Managed Service for Kubernetes, create your first cluster for Kubernetes and a child node group, and connect to the cluster.

Prepare your environment

Install the CLIs and tools

In this guide, you will use the terminal in your environment, e.g. on your local machine, to run commands that create and manage Nebius AI Cloud resources. The commands use certain command line interfaces (CLIs) and tools that you need to install first. The installation commands in copy-and-paste blocks are as follows:
sudo apt-get install jq
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
curl -sSL https://storage.eu-north1.nebius.cloud/cli/install.sh | bash
nebius profile create
These commands will install the following:
  • kubectl (how to install) is the Kubernetes command line interface.
  • jq (how to install) parses JSON outputs from the Nebius AI Cloud CLI and extracts resource IDs for other commands.
  • Nebius AI Cloud CLI (how to install) manages all Nebius AI Cloud resources.
The last command, nebius profile create, will guide you through several prompts. After you complete the prompts, your browser will open the Nebius AI Cloud web console sign-in screen. Sign in to the web console to complete the initialization. If you have access to multiple tenants, the CLI will prompt you to choose a tenant ID. After that, save your project ID in the CLI configuration: If the project ID has not been configured during the nebius profile create flow, get the project ID and save it in the CLI configuration:
nebius config set parent-id <project_ID>

Create a cluster and a node group

  1. Your cluster’s control plane and nodes will use private IP addresses from the default subnet. Get its ID:
    export NB_SUBNET_ID=$(nebius vpc subnet list \
      --format json \
      | jq -r '.items[0].metadata.id')
    
  2. Create a cluster with a public endpoint allocated to its control plane, and get the cluster ID:
    export NB_CLUSTER_ID=$(nebius mk8s cluster create \
      --name quickstart-mk8s-cluster \
      --control-plane-subnet-id $NB_SUBNET_ID \
      --control-plane-endpoints-public-endpoint true \
      --format json | jq -r '.metadata.id')
    
    The cluster’s control plane will run the Kubernetes version 1.32, which is the default version for Managed Kubernetes clusters. To explicitly specify another supported version, add the --control-plane-version <major.minor> parameter to nebius mk8s cluster create.
  3. Create a node group and add it to the cluster:
    export NODE_USERNAME="user"
    nebius mk8s node-group create \
      --name quickstart-mk8s-nodes \
      --parent-id $NB_CLUSTER_ID \
      --fixed-node-count 2 \
      --template-resources-platform "cpu-e2" \
      --template-resources-preset "2vcpu-8gb" \
      --template-boot-disk-type network_ssd \
      --template-boot-disk-size-bytes 137438953472 \
      --template-cloud-init-user-data "$(cat <<EOF
    users:
      - name: $NODE_USERNAME
        sudo: ALL=(ALL) NOPASSWD:ALL
        shell: /bin/bash
        ssh_authorized_keys:
          - $(cat ~/.ssh/id_ed25519.pub)
    EOF
    )" \
      --template-network-interfaces "[{\"public_ip_address\": {},
                                       \"subnet_id\": \"$NB_SUBNET_ID\"}]"
    
    The command creates a group of 2 nodes. Each node is a non-GPU (--template-resources-platform "cpu-e2") virtual machine that has 2 vCPUs, 8 of RAM, a 128 GiB Network SSD boot disk and a public IP address. You will be able to connect to both nodes via SSH as user (as specified in NODE_USERNAME).

Connect to the cluster

  1. Create a kubeconfig file containing the cluster details for kubectl:
    nebius mk8s cluster get-credentials \
      --id $NB_CLUSTER_ID --external
    
  2. Check that the cluster is accessible. For example:
    • Get addresses of the control plane and cluster services:
      kubectl cluster-info
      
    • Get the list of pods:
      kubectl get pods -A
      

What’s next