Installing an NFS provider using a Rook NFS operator

Let's perform the following steps to get an NFS provider functional using the Rook NFS provider option:

  1. Clone the Rook repository:
$ git clone https://github.com/rook/rook.git
$ cd rook/cluster/examples/kubernetes/nfs/
  1. Deploy the Rook NFS operator:
$ kubectl create -f operator.yaml
  1. Confirm that the operator is running:
$ kubectl get pods -n rook-nfs-system
NAME READY STATUS RESTARTS AGE
rook-nfs-operator-54cf68686c-f66f5 1/1 Running 0 51s
rook-nfs-provisioner-79fbdc79bb-hf9rn 1/1 Running 0 51s
  1. Create a namespace, rook-nfs:
$ cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Namespace
metadata:
name: rook-nfs
EOF
  1. Make sure that you have defined your preferred storage provider as the default storage class. In this recipe, we are using openebs-cstor-default, defined in persistent storage using the OpenEBS recipe.
  2. Create a PVC:
$ cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nfs-default-claim
namespace: rook-nfs
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Gi
EOF
  1. Create the NFS instance:
$ cat <<EOF | kubectl apply -f -
apiVersion: nfs.rook.io/v1alpha1
kind: NFSServer
metadata:
name: rook-nfs
namespace: rook-nfs
spec:
serviceAccountName: rook-nfs
replicas: 1
exports:
- name: share1
server:
accessMode: ReadWrite
squash: "none"
persistentVolumeClaim:
claimName: nfs-default-claim
annotations:
# key: value
EOF
  1. Verify that the NFS pod is in the Running state:
$ kubectl get pod -l app=rook-nfs -n rook-nfs 
NAME READY STATUS RESTARTS AGE
rook-nfs-0 1/1 Running 0 2m

By observing the preceding command, an NFS server instance type will be created.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.82.21