Mount file storage
File storage can be mounted:
Mount file storage to a cloud server
The mount 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 NFS protocol package:
sudo apt install nfs-common -
Create a folder to mount the repository:
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 control panel: in the top menu, click Products → File Storage → Storage page → tab Settings → field IP;<mountpoint_uuuid>- The ID of the mountpoint. You can look in control panel: in the top menu, click Products → File Storage → Storage page → Block Connection → tab GNU/Linux.
Mount file storage to a dedicated server
NFSv4
CIFS SMBv3
Linux
Windows
-
Open the CLI.
-
Install the NFS protocol package:
sudo apt install nfs-common -
Create a folder to mount the repository:
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 control panel: in the top menu, click Products → File Storage → Storage page → tab Settings → field IP;<mountpoint_uuuid>- The ID of the mountpoint. You can look in control panel: in the top menu, click Products → File Storage → Storage page → Block Connection → tab GNU/Linux.
Mount file storage to a Managed Kubernetes cluster
The mount process depends on the file storage protocol: NFSv4 or CIFS SMBv3.
NFSv4
CIFS SMBv3
1. Create 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), e.g.100 Gi. The limit is from 50 GB to 50 TB;<mountpoint_uuuid>- The ID of the mountpoint. You can look in control panel: in the top menu, click Products → File Storage → Storage page → Block Connection → tab GNU/Linux;<filestorage_ip_address>- IP address of the file storage. You can view it in control panel: in 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>is the name of the manifest yaml file to create the PersistentVolume. -
Make sure that a 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>is the name of the manifest yaml file to create the PersistentVolumeClaim. -
Ensure that a PersistentVolumeClaim object is created:
kubectl get pvc
3. Add storage to a 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 to which the file store will be mounted. -
Apply the manifest:
kubectl apply -f <deployment.yaml>Specify
<deployment.yaml>is the name of the yaml file with the manifest to create the Deployment..