Creating NFS exports

NFS exports are created by creating a Persistent Volume Claim (PVC) against the ocs-storagecluster-ceph-nfs StorageClass.

NFS PVCs can be created either by using a YAML file or from the OpenShift Container Platform web console.

Create NFS PVC using a YAML file

Use the following example PVC, where <desired_name> specifies a name for the PVC, for example, my-nfs-export.
Note: volumeMode: Block will not work for NFS volumes.
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
 name: <desired_name>
spec:
 accessModes:
   - ReadWriteOnce
 resources:
   requests:
     storage: 1Gi
 storageClassName: ocs-storagecluster-ceph-nfs
The export is created once the PVC reaches the Bound state.

Create NFS PVCs from the OpenShift Container Platform web console

Ensure that you are logged into the OpenShift Container Platform web console and the NFS feature is enabled for the storage cluster.
  1. From the OpenShift Web Console go to Storage > Persistent Volume Claims.
  2. Set the Project to openshift-storage.
  3. Click Create PersistentVolumeClaim and fill in the form.
    1. Specify the Storage Class: ocs-storagecluster-ceph-nfs.
    2. Specify the PVC Name. For example, my-nfs-export.
    3. Select the required Access Mode.
    4. Specify a Size as per application requirement.
    5. Select Volume mode: Filesystem.
      Note: Block mode is not supported for NFS PVCs.
    6. Click Create and wait until the PVC is in a Bound status.