Mount an NFS Volume
The following steps guide you through the process of connecting Network File Storage (NFS) with Persistent Volume Claims (PVCs) in a Managed Kubernetes cluster.
Note: Network File Storage (NFS) Kubernetes integration is currently available on a request basis. To access this product, please contact your sales representative or IONOS Cloud Support.
Prerequisites:
Ensure that the NFS volume and the Managed Kubernetes node pool are connected to the same private LAN.
Node pools can only retrieve their IPs in the private LAN via Dynamic Host Configuration Protocol (DHCP). Each private LAN has its own subnet distributed by the DHCP server.
The subnet of a private LAN becomes visible via the API when attaching a server to the LAN with a NIC, or by opening a node shell on the Kubernetes Cluster and inspecting the network interfaces.
To connect NFS with PVCs in a Managed Kubernetes cluster via the DCD (Data Center Designer), follow these steps:
Drag a
vCPU Server
into the workspace to add a new server in the DCD.Click Add NIC. This action creates a new Network Inteface Controller (NIC) with a new private LAN. Note the LAN number.
Click PROVISION CHANGES.
Once the changes are provisioned, inspect the server’s NIC to see its primary IP in the private LAN. For example,
10.7.228.11
. This reveals the private LAN’s DHCP subnet. For example,10.7.228.0/24
.Provision a Kubernetes Cluster.
Provision a node pool for the Kubernetes Cluster and attach the previously created private LAN. Ensure that DHCP is enabled.
Provision an NFS Cluster with the same private LAN Attached.
Assign a static IP to the NFS cluster within the same subnet identified earlier. For example,
10.7.228.5/24
.Provision an NFS Share. For more information, see Create Shares.
Add the
10.7.228.0/24
subnet and a client group to establish the necessary permissions for Kubernetes and any other hosts within that subnet to access NFS.Delete the
vCPU Server
created in the first step.
Deploy an NFS Provisioner on Your Kubernetes Cluster
Choose one of the following NFS provisioners:
Both provisioners create a custom StorageClass
configured with an NFS server. Use the static IP assigned earlier, for example, 10.7.228.5
, as the server and /SHARE_UUID/SHARE_NAME
as the share path.
Configure StorageClass for Managed Kubernetes
Managed Kubernetes requires a specific setting for the StorageClass
because PersistentVolumes need a specific mount setting. Apply the following command:
Using nfs-subdir-external-provisioner
Refer to the nfs-subdir-external-provisioner documentation for detailed instructions.
When creating PVCs, specify the custom StorageClass
name. The PVCs should then get provisioned using the specified provisioner.
Using csi-driver-nfs
Install the helm chart for csi-driver-nfs
:
Create a StorageClass
with the necessary parameters:
Create a PVC:
Result: The Managed Kubernetes cluster can now mount NFS volumes as PVCs.
Last updated