Skip to main content

Mount File Storage

File storage can be mounted to:

Mount File Storage to a Cloud Server

The mounting process depends on the operating system on the server and the file storage protocol: NFSv4 or CIFS SMBv3.

  1. Connect to the cloud server.

  2. Open the CLI.

  3. Install the package for the NFS protocol:

    sudo apt install nfs-common
  4. Create a folder for mounting the storage:

    sudo mkdir -p /mnt/nfs
  5. Mount the file storage:

    sudo mount -vt nfs "<filestorage_ip_address>:/shares/share-<mountpoint_uuid>" /mnt/nfs

    Specify:

    • <filestorage_ip_address> — file storage IP address. You can view it in the control panel: from the top menu, click ProductsFile Storage → storage page → Settings tab → IP field;
    • <mountpoint_uuid> — mount point ID. You can view it in the control panel: from the top menu, click ProductsFile Storage → storage page → Connection block → GNU/Linux tab.

Mount File Storage to a Dedicated Server

  1. Connect to a dedicated server.

  2. Open the CLI.

  3. Install the package for working with the NFS protocol:

    sudo apt install nfs-common
  4. Create a folder for mounting the storage:

    sudo mkdir -p /mnt/nfs
  5. Mount the file storage:

    sudo mount -vt nfs "<filestorage_ip_address>:/shares/share-<mountpoint_uuid>" /mnt/nfs

    Specify:

    • <filestorage_ip_address> — IP address of the file storage. You can view it in the control panel: from the top menu, click ProductsFile Storage → storage page → Settings tab → IP;
    • <mountpoint_uuid> — mount point ID. You can view it in the control panel: from the top menu, click ProductsFile Storage → storage page → Connection block → GNU/Linux.

Mount File Storage to a Managed Kubernetes Cluster

The mounting process depends on the file storage protocol: NFSv4 or CIFS SMBv3.

  1. Create a PersistentVolume.

  2. Create a PersistentVolumeClaim.

  3. Add file storage to the container.

1. Create a PersistentVolume

  1. Connect to the Managed Kubernetes cluster.

  2. Create a yaml file with a manifest for the PersistentVolume object:

    apiVersion: v1
    kind: PersistentVolume
    metadata:
    name: pv_name
    spec:
    storageClassName: storageclass_name
    capacity:
    storage: <storage_size>
    accessModes:
    - ReadWriteMany
    nfs:
    path: /shares/share-<mountpoint_uuid>
    server: <filestorage_ip_address>

    Specify:

    • <storage_size> — PersistentVolume size in GB (file storage size), for example 100 Gi. The limit is from 50 GB to 50 TB;
    • <mountpoint_uuid> — mount point ID. You can view it in the control panel: from the top menu, click ProductsFile Storage → storage page → block Connection → tab GNU/Linux;
    • <filestorage_ip_address> — file storage IP address. You can view it in the control panel: from the top menu, click ProductsFile Storage → storage page → tab Settings → field IP.
  3. Apply the manifest:

    kubectl apply -f <persistent_volume.yaml>

    Specify <persistent_volume.yaml> — the name of the yaml file with the manifest to create the PersistentVolume.

  4. Make sure the PersistentVolume object is created:

    kubectl get pv

2. Create a PersistentVolumeClaim

  1. Create a yaml file with a manifest for the PersistentVolumeClaim object:

    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
    name: pvc_name
    spec:
    storageClassName: storageclass_name
    accessModes:
    - ReadWriteMany
    resources:
    requests:
    storage: <storage_size>

    Specify <storage_size> — PersistentVolume (file storage) size in GB, for example 100 Gi. The limit is from 50 GB to 50 TB.

  2. Apply the manifest:

    kubectl apply -f <persistent_volume_claim.yaml>

    Specify <persistent_volume_claim.yaml> — the name of the yaml file with the manifest to create the PersistentVolumeClaim.

  3. Make sure the PersistentVolumeClaim object is created:

    kubectl get pvc

3. Add storage to the container

  1. Create a yaml file with a manifest for the Deployment object:

    apiVersion: apps/v1
    kind: Deployment
    metadata:
    name: filestorage_deployment_name
    labels:
    project: filestorage_deployment_name
    spec:
    replicas: 2
    selector:
    matchLabels:
    project: filestorage_project_name
    template:
    metadata:
    labels:
    project: filestorage_project_name
    spec:
    volumes:
    - name: volume_name
    persistentVolumeClaim:
    claimName: pvc_name
    containers:
    - name: container-nginx
    image: nginx:stable-alpine
    ports:
    - containerPort: 80
    name: "http-server"
    volumeMounts:
    - name: volume_name
    mountPath: <mount_path>

    Specify <mount_path> — the path to the folder inside the container where the file storage will be mounted.

  2. Apply the manifest:

    kubectl apply -f <deployment.yaml>

    Specify <deployment.yaml> — the name of the yaml file with the manifest to create the Deployment.