Niraj Kumar
Niraj Kumar

Reputation: 241

How to mount aws EC2 files on aws EKS as presistent volume?

I have a aws EC2 (EC2-A) and Amazon Managed Blockchain running in VPC (VPC-A)

I have an aws EKS (Kubernetes cluster) running in VPC-B.

How can I access the files and certificates of EC2-A from a pod in my k8s cluster. Also I have another pod which will be blockchain client executing transactions in the blockchain network, which is in VPC-A.

Both these VPC-A and VPC-B are in the same aws account.

Upvotes: 1

Views: 538

Answers (2)

Chuong Nguyen
Chuong Nguyen

Reputation: 1162

You need to connect 2 VPCs with VPC Peering, then you can install NFS in your EC2, and write PV, PVC point to the NFS EC2.

Upvotes: 1

gohm'c
gohm'c

Reputation: 15490

Mount a folder/files on an EC2 instance to a pod running in EKS is not supported. For your use case, you can easily share folder/files using EFS if not S3. If you are only allow to do pod to EC2 communication, you need a way for these resources to reach each other either by public IP if not VPC peering. Then you can run sftp, scp... any kind of off the shelf file sharing software you knew best for file exchange.

Upvotes: 2

Related Questions