Ahmed Ali
Ahmed Ali

Reputation: 41

amazon-efs failed, reason given by server: No such file or directory

apiVersion: v1
kind: PersistentVolume
metadata:
    name: ****-pv-public
    namespace: ****
spec:
    storageClassName: efs-sc
    capacity:
        storage: 3Gi
    accessModes:
        - ReadWriteMany
    persistentVolumeReclaimPolicy: Retain
    csi:
        driver: efs.csi.aws.com
        volumeHandle: fs-***
        volumeAttributes:
            path: /***/public
Mounting arguments: -t efs -o tls fs-2f974c54:/****/public /var/lib/kubelet/pods/9784d80e-4678-4b0b-96ae-a5cccf7db7a0/volumes/kubernetes.io~csi/******/mount
Output: Could not start amazon-efs-mount-watchdog, unrecognized init system "aws-efs-csi-dri"
b'mount.nfs4: mounting 127.0.0.1:/****/public failed, reason given by server: No such file or directory'

Upvotes: 0

Views: 9038

Answers (3)

Anton Balashov
Anton Balashov

Reputation: 1030

In my case I had the same issue because I didn't specify user in EFS access point. For example for resource "aws_efs_access_point" terraform resource:

  root_directory {
    path = "/main"
     creation_info {
       owner_gid   = 1000
       owner_uid   = 1000
       permissions = "755"
     }
    }

   posix_user {
     uid = 1000
     gid = 1000
   }

Upvotes: 0

Ahmed Ali
Ahmed Ali

Reputation: 41

Here, how I fixed it first, create an access point

apiVersion: v1
    kind: PersistentVolume
    metadata:
        name: **-pv-public
        namespace: laravel-test
    spec:
        storageClassName: efs-sc
        capacity:
            storage: 3Gi
        accessModes:
            - ReadWriteMany
        persistentVolumeReclaimPolicy: Retain
        csi:
            driver: efs.csi.aws.com
            volumeHandle: fs-**::fsap-***

and fs-::fsap-* (::) not (:)

Upvotes: 1

Amjad Hussain Syed
Amjad Hussain Syed

Reputation: 1040

does the sub directory exists which you're mounting? also can you try adding like this? As per the example the path should exists.

Replace FileSystemId of the EFS filesystem ID that needs to be mounted. And replace Path with a existing path on the filesystem.

you can refer this link:

https://github.com/kubernetes-sigs/aws-efs-csi-driver/tree/master/examples/kubernetes/volume_path

apiVersion: v1
kind: PersistentVolume
metadata:
  name: efs-****-pv
spec:
  capacity:
    storage: 15Gi
  volumeMode: Filesystem
  mountOptions:
    - tls
  accessModes:
    - ReadWriteMany
  persistentVolumeReclaimPolicy: Retain
  storageClassName: efs-sc
  csi:
    driver: efs.csi.aws.com
    volumeHandle: fs-*****:/****

Upvotes: 0

Related Questions