14.2. Creating NFS exports
NFS exports are created by creating a Persistent Volume Claim (PVC) against the ocs-storagecluster-ceph-nfs StorageClass.
You can create NFS PVCs two ways:
Create NFS PVC using a yaml.
The following is an example PVC.
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
- <desired_name>
-
Specify a name for the PVC, for example,
my-nfs-export.
The export is created once the PVC reaches the Bound state.
Create NFS PVCs from the OpenShift Container Platform web console.
Prerequisites
- Ensure that you are logged into the OpenShift Container Platform web console and the NFS feature is enabled for the storage cluster.
Procedure
-
In the OpenShift Web Console, click Storage
Persistent Volume Claims - Set the Project to openshift-storage.
Click Create PersistentVolumeClaim.
-
Specify Storage Class,
ocs-storagecluster-ceph-nfs. -
Specify the PVC Name, for example,
my-nfs-export. - Select the required Access Mode.
- Specify a Size as per application requirement.
Select Volume mode as
Filesystem.Note:
Blockmode is not supported for NFS PVCs-
Click Create and wait until the PVC is in
Boundstatus.
-
Specify Storage Class,