Kubernetes minikube上的NFS服务器报告`exportfs:/不支持NFS导出`

时间:2019-06-12 10:13:25

标签: kubernetes nfs minikube

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

exportfs是指什么?我该如何进一步诊断?

在nfs窗格中,不太确定为什么要导出/吗?

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

1 个答案:

答案 0 :(得分:0)

  

不太清楚为什么要导出/

这是通过run_nfs.sh脚本完成的,并带有两个参数:

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

图像gcr.io/google_containers/volume-nfs存在问题,因此建议改用jsafrane/nfs-data图像

请参见相应的github discussion