Last active
September 25, 2024 06:22
-
-
Save crazytaxii/015569be3bb842458ce820adba9eb3e4 to your computer and use it in GitHub Desktop.
Deploy NFS server and CSI on Kubernetes
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
#!/bin/bash | |
set -e | |
DRIVER_VERSION="v4.8.0" | |
main() { | |
# deploy nfs server | |
kubectl create -f https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/master/deploy/example/nfs-provisioner/nfs-server.yaml | |
# deploy nfs csi driver | |
curl -skSL "https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/$DRIVER_VERSION/deploy/install-driver.sh" | bash -s v4.8.0 -- | |
# create storage class | |
kubectl create -f "https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/refs/tags/$DRIVER_VERSION/deploy/storageclass.yaml" | |
# make nfs-csi storage class default | |
kubectl patch storageclass nfs-csi -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}' | |
} | |
main "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment