Skip to content

Instantly share code, notes, and snippets.

@kincl
Forked from johnsimcall/openshift-nfs.txt
Last active July 26, 2022 16:26
Show Gist options
  • Save kincl/ed5efdb05e8a3f6bba004cdfc0f42d3f to your computer and use it in GitHub Desktop.
Save kincl/ed5efdb05e8a3f6bba004cdfc0f42d3f to your computer and use it in GitHub Desktop.
Simplified NFS storage for OpenShift
git clone https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner.git
cd nfs-subdir-external-provisioner
sed -i.backup 's/nfs-client/nfs-storage/g' ./deploy/class.yaml
sed -i.backup 's/namespace:.*/namespace: nfs-storage/g' ./deploy/rbac.yaml
sed -i.backup 's/namespace:.*/namespace: nfs-storage/g' ./deploy/deployment.yaml
vi ./deploy/deployment.yaml
# Update NFS_SERVER and NFS_PATH values (4 edits required)
diff -U0 ./deploy/class.yaml{.backup,}
diff -U0 ./deploy/rbac.yaml{.backup,}
diff -U0 ./deploy/deployment.yaml{.backup,}
oc new-project nfs-storage
oc create -f ./deploy/rbac.yaml
oc adm policy add-scc-to-user hostmount-anyuid system:serviceaccount:nfs-storage:nfs-client-provisioner
oc create -f ./deploy/deployment.yaml
oc create -f ./deploy/class.yaml
oc annotate storageclass/nfs-storage storageclass.kubernetes.io/is-default-class=true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment