Skip to content

Instantly share code, notes, and snippets.

@WillNilges
Last active November 11, 2020 14:52
Show Gist options
  • Save WillNilges/714d92f5bfdecd3ac14dffc81966aa7d to your computer and use it in GitHub Desktop.
Save WillNilges/714d92f5bfdecd3ac14dffc81966aa7d to your computer and use it in GitHub Desktop.
Simple script to set up an nfs pv on OKD4
#!/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
@WillNilges
Copy link
Author

Moving this to github.com/willnilges/okd4-utils

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment