NFS server on Kubernetes minikube reports `exportfs: / does not support NFS export`

6/12/2019
kubectl logs nfs-685944f556-r2pjr                     
Serving /exports
Serving /
rpcinfo: can't contact rpcbind: : RPC: Unable to receive; errno = Connection refused
Starting rpcbind
exportfs: / does not support NFS export
NFS started

nfs.deployment.yaml:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nfs
  labels:
    app: nfs
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nfs
  template:
    metadata:
      labels:
        app: nfs
    spec:
      containers:
      - name: nfs-server
        image: gcr.io/google_containers/volume-nfs:0.8
        ports:
          - name: nfs
            containerPort: 2049
          - name: mountd
            containerPort: 20048
          - name: rpcbind
            containerPort: 111
        securityContext:
          privileged: true
        volumeMounts:
          - mountPath: /exports
            name: mypvc
      volumes:
        - name: mypvc
          persistentVolumeClaim:
            claimName: nfs-data

What does exportfs refer to? How can I diagnose this further?

Within the nfs pod, not too sure why it's exporting /?

[root@nfs-685944f556-r2pjr /]# cat /etc/exports
/exports *(rw,fsid=0,insecure,no_root_squash)
/ *(rw,fsid=0,insecure,no_root_squash)
-- Chris Stryczynski
kubernetes
minikube
nfs

1 Answer

7/22/2019

not too sure why it's exporting /

It is done by run_nfs.sh script, running with two arguments:

/bin/bash /usr/local/bin/run_nfs.sh /exports /

There's an issue with the image gcr.io/google_containers/volume-nfs, so it is suggested to use jsafrane/nfs-data image instead

See the corresponding github discussion

-- A_Suh
Source: StackOverflow