Connect file storage to a Managed Kubernetes cluster in a single pool
If you need to increase disk space with file storage, we recommend creating storage in the same pool as the Managed Kubernetes cluster. If the file storage and the Managed Kubernetes cluster are in the same pool, you must mount the storage to connect it.
If you plan to use file storage to store backups, we recommend creating the Managed Kubernetes storage and cluster in pools from different availability zones or regions to improve fault tolerance. For more details, see the Connect file storage to a Managed Kubernetes cluster in another pool instructions.
Create file storage
-
In Control Panel, go to Cloud Platform → File Storage.
-
Click Create Storage.
-
Enter a new storage name or leave the name that is automatically created.
-
Select the pool where the Managed Kubernetes cluster is located. A vault will be created in this pool.
-
Select the subnet of the cloud private network. We recommend choosing the subnet where the nodes of the Managed Kubernetes cluster are located — this will automatically configure the network connectivity between the nodes and the storage.
-
Select file storage type. Storages differ in read/write speeds and bandwidth values:
-
HDD Basic;
-
SSD Universal;
-
SSD Fast.
Once created, the storage type cannot be changed.
-
-
Specify the storage size: from 50 GB to 50 TB. Once created, you can increase file-storage, but you can't decrease it.
-
Select a protocol:
-
NFSv4 — for connecting storage to servers running Linux and other Unix systems;
-
CIFS SMBv3 — for connecting the storage to Windows servers.
Once created, the protocol cannot be changed.
-
-
Check out the cost of file storage.
-
Press Create.
Mount file storage to a Managed Kubernetes cluster
The mounting process depends on the file storage protocol: mount storage using NFSv4 protocol or CIFS SMBv3.
Mount storage using NFSv4 protocol
Create PersistentVolume
-
Create a yaml file
filestorage_persistent_volume.yaml
with a manifest for PersistentVolume: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>
is the size of the file storage in GB (PersistentVolume size), for example,100 Gi
. The limit is from 50 GB to 50 TB;<mountpoint_uuid>
— mount point ID. You can look in Control Panel under Cloud Platform → File Storage → Storage page → Connectivity block → GNU/Linux tab;<filestorage_ip_address>
— IP address of the file storage. You can look in control panel under Cloud Platform → File Storage → Storage page → Settings tab → IP field.
-
Create PersistentVolume — apply the manifest:
kubectl apply -f filestorage_persistent_volume.yaml
-
Verify that PersistentVolume has been created:
kubectl get pv
Create PersistentVolumeClaim
-
Create a yaml file
filestorage_persistent_volume_claim.yaml
with a manifest for PersistentVolumeClaim:apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc_name
spec:
storageClassName: storageclass_name
accessModes:
- ReadWriteMany
resources:
requests:
storage: <storage_size>Specify
<storage_size>
— the file storage size in GB (PersistentVolume size), for example,100 Gi
. The limit is from 50 GB to 50 TB. -
Create PersistentVolumeClaim — apply the manifest:
kubectl apply -f filestorage_persistent_volume_claim.yaml
-
Check that PersistentVolumeClaim has been created:
kubectl get pvc