How to attach an EKS volume directly to an EKS Pod

7/24/2019

I have a requirement where I would like to mount an EFS that has been created in AWS to be attached directly to a POD in an EKS cluster without mounting it on the actual EKS node.

My understanding was that if the EFS can be treated as an NFS server, then a PV/PVC can be created out of this and then directly mounted onto an EKS Pod.

I have done the above using EBS but with a normal vanilla Kubernetes and not EKS, I would like to know how to go about it for EFS and EKS. Is it even possible? Most of the documentations that I have read say that the mount path is mounted on the node and then to the k8s pods. But I would like to bypass the mounting on the node and directly mount it to the EKS k8s pods.

Are there any documentations that I can refer?

-- user1452759
amazon-efs
aws-eks
kubernetes
nfs

1 Answer

10/1/2019

That is not possible, because pods exist on nodes, therefore it has to be mounted on the nodes that host the pods.

Even when you did it with EBS, under the bonnet it was still attached to the node first.

However, you can restrict access to AWS resources with IAM using kube2iam or you can use the EKS native solution to assign IAM roles to Kubernetes Service Accounts. The benefit of using kube2iam is it going to work with Kops should you migrate to it from EKS.

-- aries1980
Source: StackOverflow