Search code examples
amazon-web-servicesamazon-eks

aws private eks, how to expose service to public


I created an private eks cluster by terraform, and I followed the guide at this page: https://tf-eks-workshop.workshop.aws/500_eks-terraform-workshop.html, and network architecture is below: Text

Then I deployed my web application in the eks cluster, and the application only accesses aws resource, so it works as expected, but the problem is the eks is in private vpc, and internet alb can't be attached to it, so I'm not able to access my application from public web browser, is there any idea to implement it ?

I've set up the vpc peering between eks vpc and cicd vpc. For the application deployment part, I create a service, which type is NodePort


Solution

  • Unfortunately the guide link here doesn't open for me, it seems from the VPC Diagram that you have a private subnet within your VPC for EKS, you can do the following -

    1. Create a Private Ingress resource Using ALB Ingress (For Routing traffic based on hostname within the services within the cluster) - https://docs.aws.amazon.com/eks/latest/userguide/alb-ingress.html

    2. And then route traffic from Route53 to Internal LB, if its not reachable still, attach a LB in the default VPC and pass it on to the Internal Ingress Controller. Logically that should work.

    3. EC2s in the same VPC can talk to each other if SGs are open, so by that logic forwarding traffic from Public Subnet to Private shouldn't be an issue.