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-clientandnfsdirectories,nfs-clientmeans we already has a nfs server and use it on client.nfsmeans 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.
-
Setup NFS server
-
Install nfs-utils on all worker nodes See my blog NFS Server and Client Setup, this
Server Setupchapter. -
Setup NFS provisioner This blog give me clear instruction on how to adopt the
nfs-clientprovisioner: openshift dynamic NFS persistent volume using NFS-client-provisioner.
Notces:
-
I find a bug in this project, when set rbac, you need to specify
-n test-1, otherwise the role was created intest-1but rolebinding is created in default namespace. -
The NFS provisioner is global scoped.
-
The
NFS_SERVERenv in deployment.yaml can be hostname or IP address. -
If several pods use the same PVC, they share the same PV.
-
you can customize the storage class if it’s available. For example, set the reclaim policy as
retaininstead ofdelete. see doc.
1 | apiVersion: storage.k8s.io/v1 |