Recommand · October 22, 2021 0

EFS CSI Driver mounting

Trying to configure EFS CSI driver configuration in EKS cluster with dynamic provisioning, i followed https://docs.aws.amazon.com/eks/latest/userguide/efs-csi.html this documentation but still not able to complete the installation.

  1. pod.yaml file
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: efs-claim
spec:
  accessModes:
    - ReadWriteMany
  storageClassName: efs-sc
  resources:
    requests:
      storage: 5Gi
---
apiVersion: v1
kind: Pod
metadata:
  name: efs-app
spec:
  containers:
    - name: app
      image: centos
      command: ["/bin/sh"]
      args: ["-c", "while true; do echo $(date -u) >> /data/out; sleep 5; done"]
      volumeMounts:
        - name: persistent-storage
          mountPath: /data
  volumes:
    - name: persistent-storage
      persistentVolumeClaim:
        claimName: efs-claim

  1. storageclass..yaml
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: efs-sc
provisioner: efs.csi.aws.com
parameters:
  provisioningMode: efs-ap
  fileSystemId: fs-05543c31
  directoryPerms: "700"
  gidRangeStart: "1000" # optional
  gidRangeEnd: "2000" # optional
  basePath: "/dynamic_provisioning" # optional

kubectl pv,pvc

kubectl get pv,pvc
NAME                                                        CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM               STORAGECLASS   REASON   AGE
persistentvolume/pvc-3a46e822-fbb9-4e1b-a117-5b73e562a179   5Gi        RWX            Delete           Bound    default/efs-claim   efs-sc                  12m

NAME                              STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
persistentvolumeclaim/efs-claim   Bound    pvc-3a46e822-fbb9-4e1b-a117-5b73e562a179   5Gi        RWX            efs-sc         12m

kubectl efs-csi-controller logs

I1022 12:03:16.085917       1 controller.go:1332] provision "default/efs-claim" class "efs-sc": started
I1022 12:03:16.086137       1 event.go:282] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"default", Name:"efs-claim", UID:"3a46e822-fbb9-4e1b-a117-5b73e562a179", APIVersion:"v1", ResourceVersion:"3693967", FieldPath:""}): type: 'Normal' reason: 'Provisioning' External provisioner is provisioning volume for claim "default/efs-claim"
I1022 12:03:16.403687       1 controller.go:838] successfully created PV pvc-3a46e822-fbb9-4e1b-a117-5b73e562a179 for PVC efs-claim and csi volume name fs-05543c3166d36637a::fsap-0704e0762d208f9db
I1022 12:03:16.403721       1 controller.go:1439] provision "default/efs-claim" class "efs-sc": volume "pvc-3a46e822-fbb9-4e1b-a117-5b73e562a179" provisioned
I1022 12:03:16.403744       1 controller.go:1456] provision "default/efs-claim" class "efs-sc": succeeded
I1022 12:03:16.414031       1 event.go:282] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"default", Name:"efs-claim", UID:"3a46e822-fbb9-4e1b-a117-5b73e562a179", APIVersion:"v1", ResourceVersion:"3693967", FieldPath:""}): type: 'Normal' reason: 'ProvisioningSucceeded' Successfully provisioned volume pvc-3a46e822-fbb9-4e1b-a117-5b73e562a179
kubecctl get pod


NAME      READY   STATUS              RESTARTS   AGE
efs-app   0/1     ContainerCreating   0          13m




kubectl describe pod


Events:
  Type     Reason            Age                  From               Message
  ----     ------            ----                 ----               -------
  Warning  FailedScheduling  14m (x2 over 14m)    default-scheduler  0/1 nodes are available: 1 pod has unbound immediate PersistentVolumeClaims.
  Normal   Scheduled         14m                  default-scheduler  Successfully assigned default/efs-app to ip-10-255-112-139.eu-central-1.compute.internal
  Warning  FailedMount       3m10s (x5 over 12m)  kubelet            Unable to attach or mount volumes: unmounted volumes=[persistent-storage], unattached volumes=[persistent-storage default-token-nlh22]: timed out waiting for the condition
  Warning  FailedMount       107s (x14 over 14m)  kubelet            MountVolume.SetUp failed for volume "pvc-3a46e822-fbb9-4e1b-a117-5b73e562a179" : rpc error: code = Internal desc = Could not mount "fs-05543c31:/" at "/var/lib/kubelet/pods/80b9b5e2-63a7-46e4-af92-e308d2129d0c/volumes/kubernetes.io~csi/pvc-3a46e822-fbb9-4e1b-a117-5b73e562a179/mount": mount failed: exit status 1
Mounting command: mount
Mounting arguments: -t efs -o accesspoint=fsap-0704e0762d208f9db,tls fs-05543c31:/ /var/lib/kubelet/pods/80b9b5e2-63a7-46e4-af92-e308d2129d0c/volumes/kubernetes.io~csi/pvc-3a46e822-fbb9-4e1b-a117-5b73e562a179/mount
Output: Failed to resolve "fs-05543c31.efs.eu-central-1.amazonaws.com". The file system mount target ip address cannot be found, please pass mount target ip address via mount options.

Note also i have tried manual mount inside the worker node using IP address

sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport 10.255.1.2:/ efs

cloud you please some one help me how to fix this issue.