Last active
November 11, 2020 14:52
-
-
Save WillNilges/714d92f5bfdecd3ac14dffc81966aa7d to your computer and use it in GitHub Desktop.
Simple script to set up an nfs pv on OKD4
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 | |
# Args: $1 - PV name | |
# $2 - Storage qty | |
# $3 - NFS server path | |
# The NFS Share path is hardcoded, so be sure that's where you want it! | |
mkdir /var/nfsshare/$1 | |
chmod 777 /var/nfsshare/$1 | |
cat << EOT > /tmp/more_storage.yaml | |
apiVersion: v1 | |
kind: PersistentVolume | |
metadata: | |
name: $1 | |
spec: | |
capacity: | |
storage: $2 | |
accessModes: | |
- ReadWriteOnce | |
persistentVolumeReclaimPolicy: Retain | |
nfs: | |
path: /var/nfsshare/$1 | |
server: $3 | |
EOT | |
cat /tmp/more_storage.yaml | |
oc create -f /tmp/more_storage.yaml | |
oc get pv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Moving this to github.com/willnilges/okd4-utils