Skip to content

Instantly share code, notes, and snippets.

@ToroNZ
Created March 5, 2018 20:13
Show Gist options
  • Save ToroNZ/6ec50da9ba477fd64d2477e90e4bd913 to your computer and use it in GitHub Desktop.
Save ToroNZ/6ec50da9ba477fd64d2477e90e4bd913 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
set -o pipefail
export VOLUME=${volume:-24}
for i in $(seq 0 "$VOLUME"); do
volume_name="vol-${i}"
cat <<EOF | kubectl create -f -
apiVersion: v1
kind: PersistentVolume
metadata:
name: "$volume_name"
spec:
capacity:
storage: 5Gi
accessModes:
- ReadWriteOnce
nfs:
server: support1.b49b.internal
path: /exports
persistentVolumeReclaimPolicy: Recycle
EOF
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment