Notice

This document is for a development version of Ceph.

NFS with Ceph-CSI

The NFS driver (nfs.csi.ceph.com) provisions CephFS subvolumes and exports them through an NFS-Ganesha cluster that is managed by the Ceph NFS manager module. Exports are created and deleted dynamically as volumes are provisioned and destroyed. Pods mount the volumes with the ordinary NFS client, so the worker nodes need no Ceph client code at all. This makes the NFS driver a good fit for platforms where installing Ceph-specific components on every node is not practical: for example, when the kernel or system vendor does not provide the CephFS client, or when nodes should not hold Ceph credentials.

Prepare a File System and an NFS Cluster

The NFS driver builds on the CephFS driver: provision a CephFS volume and a CephX user as described in CephFS with Ceph-CSI. Then create an NFS cluster to serve the exports:

ceph nfs cluster create mynfs

Confirm that the cluster is up and note the address for client mounts:

ceph nfs cluster info mynfs

See CephFS & RGW Exports over NFS for placement options, high availability with an ingress service, and additional NFS cluster management commands.

Define a StorageClass

A minimal StorageClass for the NFS driver looks like this:

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: ceph-nfs
provisioner: nfs.csi.ceph.com
parameters:
  clusterID: <cluster id>
  fsName: mycephfs
  nfsCluster: mynfs
  server: <NFS cluster address>
reclaimPolicy: Delete
allowVolumeExpansion: true

Complete examples, including the secret references that the provisioner requires, are maintained in the Ceph-CSI NFS examples. See Deploying Ceph-CSI for how the clusterID value is determined.

Note

The worker nodes need NFS client support in the kernel. No Ceph packages are required on the nodes.

Brought to you by the Ceph Foundation

The Ceph Documentation is a community resource funded and hosted by the non-profit Ceph Foundation. If you would like to support this and our other efforts, please consider joining now.