1
0
Charlie Drage a1ae5b39ce nfs-client: rbac no longer alpha, add serviceAccount to deployment
RBCA is no longer alpha and thus `v1` is only needed.

Service account has been added to deployment.yaml in order to get the
example to work correctly.

(cherry picked from commit 95186ce5dc)
2020-09-07 05:49:08 +00:00
2020-09-07 05:48:52 +00:00
2020-03-26 07:23:01 +05:30
2020-03-26 07:23:01 +05:30
2020-09-07 05:49:08 +00:00
2020-09-07 05:49:07 +00:00
2020-03-26 07:23:01 +05:30

kubernetes nfs-client-provisioner

Docker Repository on Quay

  • pv provisioned as ${namespace}-${pvcName}-${pvName}
  • pv recycled as archieved-${namespace}-${pvcName}-${pvName}

deploy

  • modify and deploy deploy/deployment.yaml
  • modify and deploy deploy/class.yaml

ARM based

To deploy on ARM based (Raspberry PI) use deploy/deployment-arm.yaml instead of deploy/deployment.yaml

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" either edit deploy/auth/clusterrolebinding.yaml or edit the oadm policy command accordingly.

RBAC

$ kubectl create -f deploy/auth/serviceaccount.yaml
serviceaccount "nfs-client-provisioner" created
$ kubectl create -f deploy/auth/clusterrole.yaml
clusterrole "nfs-client-provisioner-runner" created
$ kubectl create -f deploy/auth/clusterrolebinding.yaml
clusterrolebinding "run-nfs-client-provisioner" created
$ kubectl patch deployment nfs-client-provisioner -p '{"spec":{"template":{"spec":{"serviceAccount":"nfs-client-provisioner"}}}}'

OpenShift

$ oc create -f deploy/auth/serviceaccount.yaml
serviceaccount "nfs-client-provisioner" created
$ oc create -f deploy/auth/openshift-clusterrole.yaml
clusterrole "nfs-client-provisioner-runner" created
$ oadm policy add-scc-to-user hostmount-anyuid system:serviceaccount:default:nfs-client-provisioner
$ oadm policy add-cluster-role-to-user nfs-client-provisioner-runner system:serviceaccount:default:nfs-client-provisioner
$ oc patch deployment nfs-client-provisioner -p '{"spec":{"template":{"spec":{"serviceAccount":"nfs-client-provisioner"}}}}'

test

  • kubectl create -f deploy/test-claim.yaml
  • kubectl create -f deploy/test-pod.yaml
  • check the folder and file "SUCCESS" created
  • kubectl delete -f deploy/test-pod.yaml
  • kubectl delete -f deploy/test-claim.yaml
  • check the folder renamed to archived-???
Description
Dynamic sub-dir volume provisioner on a remote NFS server.
Readme Apache-2.0 11 MiB
Languages
Shell 70.2%
Makefile 11.4%
Go 9.2%
Python 4.9%
Smarty 2.4%
Other 1.9%