Skip to main content
In this tutorial, you will use a Container Storage Interface (CSI) driver offered by Nebius AI Cloud to mount a Compute shared filesystem to nodes in a Managed Service for Kubernetes and use it as a persistent volume shared between Pods running on the nodes. To work with disks that can be mounted to a single node instead of shared filesystems, see Mounting disks to Pods in a Managed Service for Kubernetes® cluster.

Costs

The tutorial includes the following chargeable resources:

Prerequisites

  1. Make sure you are in a group that has at least the editor role within your tenant or project; for example, the default editors group. You can check this in the Administration → IAM section of the web console.
  2. Install and configure the Nebius AI Cloud CLI. The CLI commands in this article assume that the CLI is properly configured. For example, they omit the ID of the parent project, as it is assumed to be set in the CLI profile.
  3. Install kubectl and Helm.
  4. Install jq:
  5. Create a Managed Kubernetes cluster or use an existing one.

Steps

Create a shared filesystem

Run the command below to create a 256 GiB SSD shared filesystem:
When setting the filesystem size (size-gibibytes), make sure it is enough for all your Pods to store their data.
The filesystem that you are adding to a node group must be located in the same project as the node group’s parent cluster. For more details about projects and resource hierarchy in Nebius AI Cloud, see How resources, identities and access are managed in Nebius AI Cloud.

Create a node group and mount the filesystem to nodes

  1. Create the cloud-init user data that will mount the shared filesystem to nodes:
    This will mount the filesystem to nodes at /mnt/data as csi-storage. To use another mount point or mount tag, modify the variables.
    Do not omit nofail. If it is not specified and a node cannot find the filesystem on restart (for example, it has been deleted), the node will not boot.
  2. Create the node group:

Install the CSI driver

  1. Pull the driver’s Helm chart:
  2. Install the chart:

Mount the filesystem to Pods

Here is an example of a PersistentVolumeClaim that claims space on the shared filesystem, and a Pod that mounts the filesystem at /data through the PersistentVolumeClaim:

How to delete the created resources

Some of the created resources are chargeable. If you do not need them, delete these resources, so Nebius AI Cloud does not charge for them:
  1. Delete the node group:
    1. In the sidebar, go to  Compute → Kubernetes.
    2. Open the page of the required cluster and then go to the Node groups tab.
    3. In the row of the required node group, click  → Delete.
    4. Confirm the node group deletion.
  2. Delete the Compute shared filesystem:
    1. In the sidebar, go to  Storage → Shared filesystems.
    2. Next to the filesystem’s name, click Delete.
    3. Enter the filesystem’s name and confirm deletion.

See also