Created
December 13, 2016 09:52
-
-
Save miticojo/710007eeeb2456b008a7ce696c88fc66 to your computer and use it in GitHub Desktop.
script per generazione pv
This file contains hidden or 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
| SERVER=`hostname` | |
| COUNT=50 | |
| mkdir -p /exports | |
| chmod 770 /exports | |
| chown nfsnobody:nfsnobody /exports | |
| oc project default | |
| for i in $(seq 1 $COUNT); do | |
| PV=$(cat <<EOF | |
| apiVersion: v1 | |
| kind: PersistentVolume | |
| metadata: | |
| name: pv$(printf %04d $i) | |
| spec: | |
| capacity: | |
| storage: 5Gi | |
| accessModes: | |
| - ReadWriteMany | |
| persistentVolumeReclaimPolicy: Recycle | |
| nfs: | |
| server: $SERVER | |
| path: /exports/pv$(printf %04d $i) | |
| EOF | |
| ) | |
| echo "$PV" | oc create -f - | |
| mkdir -p /exports/pv$(printf %04d $i) | |
| chown nfsnobody:nfsnobody /exports/pv$(printf %04d $i) | |
| chmod 770 /exports/pv$(printf %04d $i) | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment