Skip to content

Commit

Permalink
Install the nfs-subdir-external-provisioner as default storageclass.
Browse files Browse the repository at this point in the history
  • Loading branch information
carboxylman committed Jan 18, 2023
1 parent b208251 commit ad74317
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
23 changes: 23 additions & 0 deletions setup-kubernetes-extra.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,29 @@ if [ "$DOLOCALREGISTRY" = "1" ]; then
$SUDO docker start local-registry
fi

# If the user wanted NFS, make a dynamic nfs subdir provisioner the default
# storageclass.
if [ -n "$DONFS" -a "$DONFS" = "1" ]; then
NFSSERVERIP=`getnodeip $HEAD $DATALAN`
helm repo add nfs-subdir-external-provisioner \
https://kubernetes-sigs.github.io/nfs-subdir-external-provisioner/
helm repo update
cat <<EOF >$OURDIR/nfs-provisioner-values.yaml
nfs:
server: "$NFSSERVERIP"
path: $NFSMOUNTDIR
mountOptions:
- "nfsvers=3"
storageClass:
defaultClass: true
EOF
helm install nfs-subdir-external-provisioner \
nfs-subdir-external-provisioner/nfs-subdir-external-provisioner \
-f $OURDIR/nfs-provisioner-values.yaml --wait
fi



logtend "kubernetes-extra"
touch $OURDIR/kubernetes-extra-done
exit 0
4 changes: 4 additions & 0 deletions setup-nfs-client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ if [ -f $LOCALSETTINGS ]; then
. $LOCALSETTINGS
fi

if [ -z "$DONFS" -o ! "$DONFS" = "1" ]; then
exit 0
fi

maybe_install_packages nfs-common
service_enable rpcbind
service_start rpcbind
Expand Down
4 changes: 4 additions & 0 deletions setup-nfs-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ if [ -f $LOCALSETTINGS ]; then
. $LOCALSETTINGS
fi

if [ -z "$DONFS" -o ! "$DONFS" = "1" ]; then
exit 0
fi

maybe_install_packages nfs-kernel-server
service_stop nfs-kernel-server

Expand Down

0 comments on commit ad74317

Please sign in to comment.