External Provisioner

Github external provisioner.

The external provisioner can be backed by many type of filesystem, here we focus on nfs-client.

Notice that in this project, you will see nfs-client and nfs directories, nfs-client means we already has a nfs server and use it on client. nfs means we don’t have a nfs server, but we share other filesystem in nfs way.

Another tool very similar is Rook, see my blog Rook Storage Orchestrator.

The Rook is more heavy and this project is lightweight.

  1. Setup NFS server

  2. Install nfs-utils on all worker nodes See my blog NFS Server and Client Setup, this Server Setup chapter.

  3. Setup NFS provisioner This blog give me clear instruction on how to adopt the nfs-client provisioner: openshift dynamic NFS persistent volume using NFS-client-provisioner.

Notces:

  1. I find a bug in this project, when set rbac, you need to specify -n test-1, otherwise the role was created in test-1 but rolebinding is created in default namespace.

  2. The NFS provisioner is global scoped.

  3. The NFS_SERVER env in deployment.yaml can be hostname or IP address.

  4. If several pods use the same PVC, they share the same PV.

  5. you can customize the storage class if it’s available. For example, set the reclaim policy as retain instead of delete. see doc.

1
2
3
4
5
6
7
8
9
10
11
12
13
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: standard
provisioner: kubernetes.io/aws-ebs
parameters:
type: gp2
## default is delete
reclaimPolicy: Retain
## allow resize the volume by editing the corresponding PVC object
## cannot shrink
allowVolumeExpansion: true
volumeBindingMode: Immediate
0%