Nfs-client-provisioner

NFS-client is an automatic provisioner that use your existing and already configured NFS server to support dynamic provisioning of Kubernetes Persistent Volumes via Persistent Volume Claims. Persistent volumes are provisioned as ${namespace}-${pvcName}-${pvName}.

This chart installs custom storage class into a Kubernetes cluster using the Helm package manager. It also installs an NFS client provisioner into the cluster which dynamically creates persistent volumes from single NFS share.

Prerequisites

  • Kubernetes 1.9+
  • Existing NFS Share

How to deploy nfs-client to your cluster.

To note again, you must already have an NFS Server.

  • Step 1: Get connection information for your NFS server. Make sure your NFS server is accessible from your Kubernetes cluster and get the information you need to connect to it. At a minimum, you will need its hostname.
  • Step 2: Get the NFS-Client Provisioner files. To set up the provisioner you will download a set of YAML files, edit them to add your NFS server's connection information and then apply each with the kubectl / oc command.

Get all of the files in the deploy directory of this repository. These instructions assume that you have cloned the external-storage repository and have a bash-shell open in the nfs-client directory.

  • Step 3: Setup authorization. If your cluster has RBAC enabled or you are running OpenShift you must authorize the provisioner. If you are in a namespace/project other than "default" edit deploy/rbac.yaml.

Kubernetes:

  • # Set the subject of the RBAC objects to the current namespace where the provisioner is being deployed
  • $ NS=$(kubectl config get-contexts|grep -e "^\*" |awk '{print $5}')
  • $ NAMESPACE=${NS:-default}
  • $ sed -i'' "s/namespace:.*/namespace: $NAMESPACE/g" ./deploy/rbac.yaml
  • $ kubectl create -f deploy/rbac.yaml

OpenShift:

On some installations of OpenShift, the default admin user does not have cluster-admin permissions. If these commands fail to refer to the OpenShift documentation for User and Role Management or contact your OpenShift provider to help you grant the right permissions to your admin user.

  • # Set the subject of the RBAC objects to the current namespace where the provisioner is being deployed
  • $ NAMESPACE=oc project -q
  • $ sed -i'' "s/namespace:.*/namespace: $NAMESPACE/g" ./deploy/rbac.yaml
  • $ oc create -f deploy/rbac.yaml
  • $ oadm policy add-scc-to-user hostmount-anyuid system:serviceaccount:$NAMESPACE:nfs-client-provisioner

Tell us about a new Kubernetes application

Newsletter

Never miss a thing! Sign up for our newsletter to stay updated.

About

Discover and share new Kubernetes applications

Navigation