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.
NFSv4
CIFS SMBv3
Linux
Windows
-
Open the CLI.
-
Install the package for the NFS protocol:
sudo apt install nfs-common -
Create a folder for mounting the storage:
sudo mkdir -p /mnt/nfs -
Mount the file storage:
sudo mount -vt nfs "<filestorage_ip_address>:/shares/share-<mountpoint_uuid>" /mnt/nfsSpecify:
<filestorage_ip_address>— file storage IP address. You can view it in the control panel: from the top menu, click Products → File 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 Products → File Storage → storage page → Connection block → GNU/Linux tab.
Mount File Storage to a Dedicated Server
NFSv4
CIFS SMBv3
Linux
Windows
-
Open the CLI.
-
Install the package for working with the NFS protocol:
sudo apt install nfs-common -
Create a folder for mounting the storage:
sudo mkdir -p /mnt/nfs -
Mount the file storage:
sudo mount -vt nfs "<filestorage_ip_address>:/shares/share-<mountpoint_uuid>" /mnt/nfsSpecify:
<filestorage_ip_address>— IP address of the file storage. You can view it in the control panel: from the top menu, click Products → File Storage → storage page → Settings tab → IP;<mountpoint_uuid>— mount point ID. You can view it in the control panel: from the top menu, click Products → File 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.
NFSv4
CIFS SMBv3
1. Create a PersistentVolume
-
Create a yaml file with a manifest for the PersistentVolume object:
apiVersion: v1kind: PersistentVolumemetadata:name: pv_namespec:storageClassName: storageclass_namecapacity:storage: <storage_size>accessModes:- ReadWriteManynfs:path: /shares/share-<mountpoint_uuid>server: <filestorage_ip_address>Specify:
<storage_size>— PersistentVolume size in GB (file storage size), for example100 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 Products → File 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 Products → File Storage → storage page → tab Settings → field IP.
-
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. -
Make sure the PersistentVolume object is created:
kubectl get pv
2. Create a PersistentVolumeClaim
-
Create a yaml file with a manifest for the PersistentVolumeClaim object:
apiVersion: v1kind: PersistentVolumeClaimmetadata:name: pvc_namespec:storageClassName: storageclass_nameaccessModes:- ReadWriteManyresources:requests:storage: <storage_size>Specify
<storage_size>— PersistentVolume (file storage) size in GB, for example100 Gi. The limit is from 50 GB to 50 TB. -
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. -
Make sure the PersistentVolumeClaim object is created:
kubectl get pvc
3. Add storage to the container
-
Create a yaml file with a manifest for the Deployment object:
apiVersion: apps/v1kind: Deploymentmetadata:name: filestorage_deployment_namelabels:project: filestorage_deployment_namespec:replicas: 2selector:matchLabels:project: filestorage_project_nametemplate:metadata:labels:project: filestorage_project_namespec:volumes:- name: volume_namepersistentVolumeClaim:claimName: pvc_namecontainers:- name: container-nginximage: nginx:stable-alpineports:- containerPort: 80name: "http-server"volumeMounts:- name: volume_namemountPath: <mount_path>Specify
<mount_path>— the path to the folder inside the container where the file storage will be mounted. -
Apply the manifest:
kubectl apply -f <deployment.yaml>Specify
<deployment.yaml>— the name of the yaml file with the manifest to create the Deployment.