Kubernetes mount.nfs: access denied by server while mounting

岁酱吖の 提交于 2019-12-01 06:59:51

It's probably because the uid used in your pod/container has not enough rights on the NFS server.

You can runAsUser as mentioned by @Giorgio or try to edit uid-range annotations of your namespace and fix a value (ex : 666). Like this every pod in your namespace will run with uid 666.

Don't forget to chown 666 properly your NFS directory.

You have to set a securityContext as privileged: true. Take a look at this link

In my case I was trying to mount the wrong directory...

      volumes:
        - name: nfs-data
          nfs: 
            # https://github.com/kubernetes/minikube/issues/3417
            # server is not resolved using kube dns (so can't resolve to a service name - hence we need the IP)
            server: 10.100.155.82
            path: /tmp

I did not have /tmp in the /etc/exports in the server...

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!