Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bunchc/5962affa33b4e0f0cde6765319f5b611 to your computer and use it in GitHub Desktop.
Save bunchc/5962affa33b4e0f0cde6765319f5b611 to your computer and use it in GitHub Desktop.
oc login -u system:admin
cat <<-EOF > /tmp/pv.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv0001
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
- ReadWriteMany
persistentVolumeReclaimPolicy: Retain
hostPath:
path: /home/goern/.oc/volumes/pv0001
EOF
for i in `seq -w 0001 0020`; do SHARE=pv$i; mkdir -p $SHARE; chmod 777 $SHARE; sed s/pv0001/pv$i/g /tmp/pv.yaml | oc create -f - --as=system:admin; done
chcon -Rt svirt_sandbox_file_t /home/goern/.oc/volumes/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment