[英]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: 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:
then I deployed my web application in the eks cluster, and the application only access aws resource, so it works as expected, but the problem is the eks is in private vpc, and internet alb can't attached to it, so I'm not able to access my application from public web browser, is there any idea to impliment it?然后我在 eks 集群中部署了我的 web 应用程序,并且该应用程序只访问 aws 资源,所以它按预期工作,但问题是 eks 在私有 vpc 中,并且 Internet alb 无法附加到它,所以我无法从公共 web 浏览器访问我的应用程序,有什么想法可以暗示吗?
I've setup the vpc peerring between eks vpc and cicd vpc.我已经在 eks vpc 和 cicd vpc 之间设置了 vpc 对等互连。 For the application deploymetn part, I create a service, which type is NodePort
对于应用程序 deploymetn 部分,我创建了一个服务,它的类型是 NodePort
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 -不幸的是,这里的指南链接没有为我打开,从 VPC 图表看来,您的 VPC 中有一个用于 EKS 的私有子网,您可以执行以下操作 -
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使用 ALB 入口创建私有入口资源(用于基于集群内服务内的主机名路由流量) - https://docs.aws.amazon.com/eks/latest/userguide/alb-ingress.html
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.然后将流量从 Route53 路由到内部 LB,如果仍然无法访问,则在默认 VPC 中附加一个 LB,并将其传递给内部入口 Controller。 Logically that should work.
从逻辑上讲,这应该有效。
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.如果 SG 处于打开状态,同一 VPC 中的 EC2 可以相互通信,因此按照这种逻辑,将流量从公共子网转发到私有应该不成问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.