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
andnfs
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.
-
Setup NFS server
-
Install nfs-utils on all worker nodes See my blog NFS Server and Client Setup, this
Server Setup
chapter. -
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:
-
I find a bug in this project, when set rbac, you need to specify
-n test-1
, otherwise the role was created intest-1
but rolebinding is created in default namespace. -
The NFS provisioner is global scoped.
-
The
NFS_SERVER
env 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
retain
instead ofdelete
. see doc.
1 | apiVersion: storage.k8s.io/v1 |