kubernetes nfs 启动nfs-client-provisioner报错

报错内容如下:

 Warning  FailedMount  21m   kubelet            MountVolume.SetUp failed for volume "nfs-client-root" : mount failed: exit status 32
Mounting command: systemd-run
Mounting arguments: --description=Kubernetes transient mount for /var/lib/kubelet/pods/9f0a9d4e-ad01-4a42-a225-f78360260691/volumes/kubernetes.io~nfs/nfs-client-root --scope -- mount -t nfs 10.9.20.36:/root/nfsfile /var/lib/kubelet/pods/9f0a9d4e-ad01-4a42-a225-f78360260691/volumes/kubernetes.io~nfs/nfs-client-root
Output: Running scope as unit run-28583.scope.
mount.nfs: Connection timed out
 

kubernetes nfs 启动nfs-client-provisioner报错_第1张图片

解决方法:

查看nfs servie所在机器的/etc/hosts

10.20.9.48 master
10.20.9.36 node01
10.20.9.10 node02

例如nfs server是在 10.20.9.36

则修改部署文件中的对应server为node01:

nfs-provisioner.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nfs-client-provisioner
  labels:
    app: nfs-client-provisioner
  namespace: kafka
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nfs-client-provisioner
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: nfs-client-provisioner
  template:
    metadata:
      labels:
        app: nfs-client-provisioner
    spec:
      serviceAccountName: nfs-client-provisioner
      containers:
        - name: nfs-client-provisioner
          image: quay.io/external_storage/nfs-client-provisioner:latest
          volumeMounts:
            - name: nfs-client-root
              mountPath: /persistentvolumes
          env:
            - name: PROVISIONER_NAME
              value: qgg-nfs-storage
            - name: NFS_SERVER
              value: node01
            - name: NFS_PATH
              value: /data/volumes
      volumes:
        - name: nfs-client-root
          nfs:
            server: node01
            path: /data/volumes

 

你可能感兴趣的:(kubernetes,kubernetes,nfs)