kubernetes-bootstrapping/07-nfs-subdir-provisioner
2023-12-22 19:54:24 -07:00
..
README.md Add NFS subdir provisioner 2023-12-22 19:54:24 -07:00

07-NFS-Subdir-Provisioner

To support persistent volume claims on NFS external storage, a provisioner can be configured and deployed easily with helm.


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=10.69.71.105 \
    --set nfs.path=/data/nfs

A PVC can then be created similar to below example:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: myclaim
spec:
  accessModes:
    - ReadWriteOnce
  volumeMode: Filesystem
  resources:
    requests:
      storage: 1Gi
  storageClassName: nfs-client
---
apiVersion: v1
kind: Pod
metadata:
  name: mypod
spec:
  containers:
    - name: myfrontend
      image: nginx
      volumeMounts:
      - mountPath: "/var/www/html"
        name: mypd
  volumes:
    - name: mypd
      persistentVolumeClaim:
        claimName: myclaim