Can't mount to nfs pod in Kubernetes Can't mount to nfs pod in Kubernetes kubernetes kubernetes

Can't mount to nfs pod in Kubernetes


mount --options port=2052 --types nfs 10.110.183.188:/upload /upload

There might a firewall preventing you from reaching port 2052. Just as an FYI if you are running NFSv4 the ports to be allowed are 111 and 2049

*mount: /upload: cannot mount 10.110.183.188:/upload read-only.

This is more of a misnomer:

rpcinfo: can't contact rpcbind: : RPC: Unable to receive; errno = Connection refused

It really looks like /upload is not exported in your webpp-upload-nfs-server container.

I checked the image and it looks good in its file system:

/exports *(rw,fsid=0,insecure,no_root_squash)/ *(rw,fsid=0,insecure,no_root_squash)

You are trying the mount from NFS:/uploads but you are exporting NFS:/exports. So you can try:

mount --options port=2052 --types nfs 10.110.183.188:/exports /upload

✌️


I am not sure what you are trying to achieve. If you are trying to save some files to hostPath volume then you don't need PV or PVC. You can save files on the host with hostPath volume.

If you want to use PVC's to control assignment and access to the host volume then you don't need webpp-upload-nfs-server (Deployment and Service). Just create the PV and PVC objects and mount the PVC directly in the target pod.

What you are doing is pretty round about. You are creating PV and PVCs for host path. Then converting that host path to NFS Share. You are missing the piece where you have to create another PV and PVC to use NFS Share. Finally, mounting that PVC in the target deployment.