Before you begin

The following are required to install the helm chart:

  1. One separate VM or a bare metal server
  2. Kubernetes on-premise cluster
  3. The Helm tool (v3+)
  4. Storage class

StorageClass configuration

Skip this section if you have already configured the NFS StorageClass.

A ‘StorageClass’ allows your k8s administrators to describe the “classes” of storage they offer. The StorageClass contains the fields provisioner, parameters, and reclaimPolicy, which are used when a PersistentVolume (PV) belonging to the class needs to be dynamically provisioned.

For using the PersistenceVolume, you must first deploy an Network File System (NFS) helm chart. Deploying the NFS helm chart will automatically create a custom StorageClass.

Installing the NFS for the Kubernetes cluster

If you do not use NFS for storage then you can skip this section.

This charts installs a 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 a single NFS share.

  • The repository for the nfs helm chart is given below:

https://github.com/helm/charts/tree/master/stable/nfs-client-provisioner

  • For deploying the helm chart, the nfs server and nfs mount path are required
  • Before installing the NFS Provisioner helm chart, you need to add a stable helm repository to your helm client as shown below:

helm repo add stable https://charts.helm.sh/stable

  • To install the chart with the deploy name nfs-client, run the following command:

helm install nfs-client --set nfs.server=x.x.x.x --set nfs.path=/exported/path stable/nfs-client-provisioner

  • The nfs-client storage class must be marked with the default annotation so that the PersistentVolumeClaim objects (without a StorageClass specified) will trigger dynamic provisioning:

kubectl patch storageclass nfs-client -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'

  • After deploying the nfs helm chart, execute the command:

kubectl get storageclass

get sc

Next Step