Created
April 12, 2018 05:31
-
-
Save marekjelen/b389dab255aaf02901311b8b4e5a630f to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
for i in {1..20}; do | |
cat <<EOF > tmp.json | |
{ | |
"apiVersion": "v1", | |
"kind": "PersistentVolume", | |
"metadata": { | |
"name": "pv-${i}" | |
}, | |
"spec": { | |
"accessModes": [ | |
"ReadWriteOnce", | |
"ReadWriteMany", | |
"ReadOnlyMany" | |
], | |
"capacity": { | |
"storage": "10Gi" | |
}, | |
"hostPath": { | |
"path": "/data/pv-${i}" | |
}, | |
"persistentVolumeReclaimPolicy": "Recycle" | |
} | |
} | |
EOF | |
mkdir -p /data/pv-$i | |
chmod 0777 /data/pv-$i | |
oc create -f tmp.json | |
rm -rf tmp.json | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment