Skip to content

Instantly share code, notes, and snippets.

@marekjelen
Created April 12, 2018 05:31
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 marekjelen/b389dab255aaf02901311b8b4e5a630f to your computer and use it in GitHub Desktop.
Save marekjelen/b389dab255aaf02901311b8b4e5a630f to your computer and use it in GitHub Desktop.
#!/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