Skip to content

NFS Storage Provider

Alexander Diemand edited this page Sep 10, 2024 · 1 revision

NFS Storage Provider

from: https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner

Installation

helm repo add nfs-subdir-external-provisioner https://kubernetes-sigs.github.io/nfs-subdir-external-provisioner
helm install nfs-subdir-external-provisioner nfs-subdir-external-provisioner/nfs-subdir-external-provisioner \
     --set nfs.server=<Server IP address> \
     --set nfs.path=<Server exported path> \
     --set nfs.mountOptions='{nfsvers=3}' \
     --set storageClass.name=nfs-data-storage \
     --set storageClass.accessModes=ReadWriteOnce

now, let's claim some storage with a PVC:

NAMESPACE=my-namespace

(cat <<EOF
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: nfs-pv-claim
  namespace: ${NAMESPACE}
spec:
  accessModes:
    - ReadWriteOnce
  volumeMode: Filesystem
  resources:
    requests:
      storage: 24Gi
  storageClassName: nfs-data-storage
EOF
) | envsubst | kubectl apply -n $NAMESPACE -f -
Clone this wiki locally