NFS operator module (NFS Provisioner)
The NFS Provisioner module is the Network File System (NFS) Container Storage Interface (CSI) driver. In Kubernetes clusters, it allows the use of NFS for data storage. NFS Provisioner is responsible for:
- the ability to statically and dynamically provide Persistent Volumes (PV) based on NFS;
- providing shared access to data across multiple applications.
Features
- For NFS to work in a cluster, the NFS client must be installed on the nodes. For example, for the RPM distribution install the utility package
nfs-utils, for DEB -nfs-common. - In clusters with Astra Linux OS up to version 1.7.6 (inclusive), when using NFS Provisioner, a “memory leak” may occur, which will lead to OOM (Out of Memory) and the crash of pods in the cluster. To avoid loss of functionality in the cluster, use one of the following methods:
Method 1
- When installing the NFS Operator Module in customvalues, use the third server (nfsvers=3). Read more about module configuration in the sections for management cluster and client-cluster.
Method 2
- Update Astra Linux version to 1.7.7. Instructions for updating are presented on Astra Linux documentation page.
After updating the OS version, the infrastructure providers (VMware vSphere, oVirt, OpenStack, Basis Dynamix, Yandex Cloud, vCloud Director) clusters will need to be replaced VM templates with old versions.
- After rebooting the node on Debian OS, a situation may arise where the PVC is not mounted. Add an additional function
nolocktomountOptionsthat disables file locking. In this case, you will need to edit previously created PVs by manually addingnolocktomountOptions.
Error example
Output: mount.nfs: rpc.statd is not running but is required for remote locking.
mount.nfs: Either use '-o nolock' to keep locks local, or start statd
Installation in a cluster
The module is not critical for the operation of the Shturval platform. By default, the module is installed in a disabled management cluster; it is not installed in client clusters.
Management Cluster
To enable the module in a deployed management cluster, go to the Installed Services page of the Services and Repositories section in the GUI. Find Operator NFS Module shturval-nfs-csi and go to management.
B bIn the Service Specification location, you can specify parameters for creating a Storage Class with the nfs.csi.k8s.io provider in the cluster or add a Storage Class after enabling the module.
Example of adding Storage Class to specifications
storageClass:
create: true
name: nfs-csi
parameters:
server: 10.11.12.13
share: /nfs # Share path
mountOptions:
- nfsvers=3
reclaimPolicy: Delete
volumeBindingMode: Immediate
Where instead of 10.11.12.13 specify the IP address of the NFS server. In mountOptions you can specify additional mount functions. When installing the service, it is recommended to use a third server (nfsvers=3), since the fourth (nfsvers=4.1) has a resource leak.
Select automatic control mode (Auto).
Client cluster
To install the NFS Operator Module in the created client cluster, go to the Available Charts page of the Services and Repositories section. On the shturval tab, select the shturval-nfs-csi chart and click Install.
Select the required version of the chart, and also create a namespace nfs. After selecting the chart version, Available configuration parameters for the service (values) will be displayed on the right side of the screen. Enter the required parameters as customvalues in the Service Specification block.
In the Service Specification block, you can specify parameters for creating a Storage Class with the nfs.csi.k8s.io provider in the cluster or add a Storage Class after enabling the module.
Example of adding Storage Class to specifications
storageClass:
create: true
name: nfs-csi
parameters:
server: 10.11.12.13
share: /nfs # Share path
mountOptions:
- nfsvers=3
reclaimPolicy: Delete
volumeBindingMode: Immediate
Where instead of 10.11.12.13 specify the IP address of the NFS server. In mountOptions you can specify additional mount functions. When installing the service, it is recommended to use a third server (nfsvers=3), since the fourth (nfsvers=4.1) has a resource leak.
Select automatic control mode (Auto).
For the NFS Module to work correctly, the Cluster Network Management Module (shturval-networking) must be enabled in the cluster.