Internal Network File System on OCP (Non-Production)

Learn about deploying, backing up, and uninstalling an internal NFS server on OpenShift Container Platform. However, for production, an external NFS server is recommended. For more information, see Using an External NFS Server.

Deploying NFS Server Provisioner on Rook Ceph

As an example, you can deploy the NFS Server Provisioner using the Helm chart provided here.

  • For the nfs storage class, set “allowVolumeExpansion=true”
  • For the underlying persistent volume, specify a size of 1 TiB.
  • On the block storage system class, rook-ceph-block in this case, set allowVolumeExpansion=true
  • Download two yaml files here: nfs-server-provisioner.yml and nfs-scc.yml.
  1. Install Path 1: Installing using the oc command and yaml files:

    1. If you do not have Tillerless Helm v2 set up, then you can simply apply the nfs-server-provisioner.yml file as follows: $ oc create -f nfs-server-provisioner.yml -n cml-nfs

  2. Install Path 2: Installing using the oc command and Tillerless Helm v2:

    $ oc delete scc nfs-scc
           $ oc delete clusterrole cml-nfs-nfs-server-provisioner 
           $ oc delete clusterrolebinding cml-nfs-nfs-server-provisioner 
           $ oc delete namespace cml-nfs
           
           $ helm tiller run cml-nfs -- helm delete cml-nfs --purge
           $ oc delete scc nfs-scc securitycontextconstraints.security.openshift.io "nfs-scc" deleted
          

Backing up Project Files and Folders

The block device backing the NFS server data must be backed up to protect the CML project files and folders. The backup mechanism would vary depending on the underlying block storage system and backup policies in place.

  1. identify the underlying block storage to backup, first determine the NFS PV:

    $ echo `kubectl get pvc -n cml-nfs -o jsonpath='{.items[0].spec.volumeName}'`
           pvc-bec1de27-753d-11ea-a287-4cd98f578292
          
  2. For Rook Ceph, the RBD volume/image name is the name of the dynamically created persistent volume (pvc-3d3316b6-6cc7-11ea-828e-1418774847a1).

Ensure this volume is backed up using an appropriate backup policy.

Uninstalling the NFS server on OpenShift

Uninstall the NFS server provisioner using either of the following commands.

Use this command if the NFS server provisioner was installed using oc and yaml files:
$ oc delete scc nfs-scc
$ oc delete clusterrole cml-nfs-nfs-server-provisioner 
$ oc delete clusterrolebinding cml-nfs-nfs-server-provisioner 
$ oc delete namespace cml-nfs
Use this command if the NFS server provisioner was installed using Helm:
$ helm tiller run cml-nfs -- helm delete cml-nfs --purge
$ oc delete scc nfs-scc securitycontextconstraints.security.openshift.io "nfs-scc" deleted