Skip to content

Instantly share code, notes, and snippets.

@mjudeikis
Created July 20, 2017 14:27
Show Gist options
  • Save mjudeikis/bc03bb1a032674545b8f32cbf575d493 to your computer and use it in GitHub Desktop.
Save mjudeikis/bc03bb1a032674545b8f32cbf575d493 to your computer and use it in GitHub Desktop.
/storage/pv1 *(rw,root_squash)
/storage/pv2 *(rw,root_squash)
/storage/pv3 *(rw,root_squash)
/storage/pv4 *(rw,root_squash)
/storage/pv5 *(rw,root_squash)
/storage/pv6 *(rw,root_squash)
/storage/pv7 *(rw,root_squash)
/storage/pv8 *(rw,root_squash)
/storage/pv9 *(rw,root_squash)
/storage/pv10 *(rw,root_squash)
/storage/pv11 *(rw,root_squash)
/storage/pv12 *(rw,root_squash)
/storage/pv13 *(rw,root_squash)
/storage/pv14 *(rw,root_squash)
/storage/pv15 *(rw,root_squash)
/storage/pv16 *(rw,root_squash)
/storage/pv17 *(rw,root_squash)
/storage/pv18 *(rw,root_squash)
/storage/pv19 *(rw,root_squash)
/storage/pv20 *(rw,root_squash)
/storage/pv21 *(rw,root_squash)
/storage/pv22 *(rw,root_squash)
/storage/pv23 *(rw,root_squash)
/storage/pv24 *(rw,root_squash)
/storage/pv25 *(rw,root_squash)
for i in {1..25} ; do
mkdir -p /storage/pv$1
done
for i in {1..25} ; do
var="\
{\
\"kind\": \"PersistentVolume\",\
\"apiVersion\": \"v1\",\
\"metadata\": {\
\"name\": \"pv$i\"\
},\
\"spec\": {\
\"capacity\": {\
\"storage\": \"1Gi\"\
},\
\"nfs\": {\
\"server\": \"nfs.containers.ninja\",\
\"path\": \"/storage/pv$i\"\
},\
\"accessModes\": [\
\"ReadWriteOnce\"\
],
\"persistentVolumeReclaimPolicy\": \"Retain\"\
}\
}"
echo $var | oc create -f -
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment