title: AWS EKS Fargate - Unable to mount EFS volume with statefulset
body: <p>I want to run a statefulSet in AWS EKS Fargate and attach a EFS volume with it, but I am getting errors in mounting a volume with pod.
  These are the error I am getting from describe pod.</p>
  <pre><code>QoS Class:                   BestEffort
  Node-Selectors:              &lt;none&gt;
  Tolerations:                 node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                               node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
  Events:
    Type     Reason          Age                From               Message
    ----     ------          ----               ----               -------
    Normal   LoggingEnabled  114s               fargate-scheduler  Successfully enabled logging for pod
    Normal   Scheduled       75s                fargate-scheduler  Successfully assigned default/app1 to fargate-10.0.2.123
    Warning  FailedMount     43s (x7 over 75s)  kubelet            MountVolume.SetUp failed for volume &quot;efs-pv&quot; : rpc error: code = Internal desc = Could not mount &quot;fs-xxxxxxxxxxxxxxxxx:/&quot; at &quot;/var/lib/kubelet/pods/b799a6d6-fe9e-4f80-ac2d-8ccf8834d7c4/volumes/kubernetes.io~csi/efs-pv/mount&quot;: mount failed: exit status 1
  Mounting command: mount
  Mounting arguments: -t efs -o tls fs-xxxxxxxxxxxxxxxxx:/ /var/lib/kubelet/pods/b799a6d6-fe9e-4f80-ac2d-8ccf8834d7c4/volumes/kubernetes.io~csi/efs-pv/mount
  Output: Failed to resolve &quot;fs-xxxxxxxxxxxxxxxxx.efs.us-east-1.amazonaws.com&quot; - check that your file system ID is correct, and ensure that the VPC has an EFS mount target for this file system ID.
  See https://docs.aws.amazon.com/console/efs/mount-dns-name for more detail.
  Attempting to lookup mount target ip address using botocore. Failed to import necessary dependency botocore, please install botocore first.
  Warning: config file does not have fall_back_to_mount_target_ip_address_enabled item in section mount.. You should be able to find a new config file in the same folder as current config file /etc/amazon/efs/efs-utils.conf. Consider update the new config file to latest config file. Use the default value [fall_back_to_mount_target_ip_address_enabled = True].
  </code></pre>
  <p>If anyone has setup efs volume with eks fargate cluster please have a look at it. I am really stucked in from long time.</p>
  <p>What I have setup</p>
  <ul>
  <li>Created a EFS Volume</li>
  <li>CSIDriver Object</li>
  </ul>
  <pre><code>apiVersion: storage.k8s.io/v1beta1
  kind: CSIDriver
  metadata:
    name: efs.csi.aws.com
  spec:
    attachRequired: false
  
  </code></pre>
  <ul>
  <li>Storage Class</li>
  </ul>
  <pre><code>kind: StorageClass
  apiVersion: storage.k8s.io/v1
  metadata:
    name: efs-sc
  provisioner: efs.csi.aws.com
  </code></pre>
  <ul>
  <li>PersistentVolume</li>
  </ul>
  <pre><code>apiVersion: v1
  kind: PersistentVolume
  metadata:
    name: efs-pv
  spec:
    capacity:
      storage: 5Gi
    volumeMode: Filesystem
    accessModes:
      - ReadWriteMany
    persistentVolumeReclaimPolicy: Retain
    storageClassName: efs-sc
    csi:
      driver: efs.csi.aws.com
      volumeHandle: &lt;EFS filesystem ID&gt;
  </code></pre>
  <ul>
  <li>PersistentVolumeClaim</li>
  </ul>
  <pre><code>apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
    name: efs-claim
  spec:
    accessModes:
      - ReadWriteMany
    storageClassName: efs-sc
    resources:
      requests:
        storage: 5Gi
  </code></pre>
  <ul>
  <li>Pod Configuration</li>
  </ul>
  <pre><code>apiVersion: v1
  kind: Pod
  metadata:
    name: app1
  spec:
    containers:
    - name: app1 
      image: busybox 
      command: [&quot;/bin/sh&quot;] 
      args: [&quot;-c&quot;, &quot;while true; do echo $(date -u) &gt;&gt; /data/out1.txt; sleep 5; done&quot;]
      volumeMounts:
      - name: persistent-storage
        mountPath: /data
    volumes:
    - name: persistent-storage
      persistentVolumeClaim:
        claimName: efs-claim
  </code></pre>