ehough / docker-nfs-server

A lightweight, robust, flexible, and containerized NFS server.
https://hub.docker.com/r/erichough/nfs-server/
GNU General Public License v3.0
669 stars 221 forks source link

Error while mounting nfs in a pod #68

Open abhilashdk2016 opened 2 years ago

abhilashdk2016 commented 2 years ago

Hi sir,

Thank you for this wonderful project.

I was able to start the server in Ubuntu 20.04.

Screenshot 2021-08-01 at 12 50 47 PM

Now I am trying to use this nfs server as volume mount using the below yaml definition: `

apiVersion: apps/v1

kind: Deployment
metadata:
  labels:
    app: busybox
  name: busybox
 spec:
  replicas: 1
  selector:
    matchLabels:
      app: busybox
  template:
    metadata:
      labels:
        app: busybox
    spec:
      containers:
      - image: busybox
        name: busybox
        command: ["/bin/sh"]
        args: ["-c","echo 'At Work!' >> /mnt/log.txt; while true; do date >> /mnt/log.txt; sleep 10; done;"]
        volumeMounts:
          - name: nfs
            mountPath: "/mnt"
      volumes:
      - name: nfs
        nfs:
          server: nfs-server
          path: /

But nfs is not being mounted and I am getting the following error:

Screenshot 2021-08-01 at 12 57 40 PM

Could you please help me in understanding how to mount a volume based of your nfs-server.

Thanks in advance.