Last active
November 8, 2023 07:39
-
-
Save johnsimcall/0428b7768e50ece76d63db5ec2ab39b5 to your computer and use it in GitHub Desktop.
Simplified NFS storage for OpenShift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~/ocp/ | |
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
A recent update to the upstream Git repo changed the StorageClass name (in deploy/class.yaml) to
nfs-client
I'm going to start looking at this NFS storage provisioner[1] alternative that promises to provide CSI capabilities (like snapshots.)
[1] - https://github.com/kubernetes-csi/csi-driver-nfs
UPDATE: I'm not entirely impressed with the securityContextConstraints, but I got it to work... Here are my notes