How to have multiple pods access an existing NFS folder in Kubernetes? How to have multiple pods access an existing NFS folder in Kubernetes? kubernetes kubernetes

How to have multiple pods access an existing NFS folder in Kubernetes?


I figured it out. The issue was I was looking at the problem the wrong way. I didn't need any provisioning. Instead, what was need was to simply mount the NFS volume within the container:

kind: PodapiVersion: v1metadata:  name: pod-using-nfsspec:  containers:    - name: app      image: alpine      volumeMounts:      - name: data        mountPath: /mnt/data      command: ["/bin/sh"]      args: ["-c", "sleep 500000"]  volumes:  - name: data    nfs:      server: 1.2.3.4      path: /media/foo/DATA