私有子网中的 EKS,公共子网中的负载均衡器 [英] EKS in private Subnet , Load Balancer in public subnet

查看:30
本文介绍了私有子网中的 EKS,公共子网中的负载均衡器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在私有子网中运行 EKS,因此无法创建面向 Internet 的负载均衡器,但能够创建内部负载均衡器.

I am running EKS in private subnet and thus unable to create an internet facing load balancer but was able to create Internal LoadBalancer.

有什么方法可以在公共子网中创建 Loadbalancer(可能手动)并指向在私有子网中的 EKS 中运行的 Pod.

Is there any way I can create Loadbalancer(probably Manually) in public subnet and point to the pods running in EKS in the private subnet.

我正在考虑创建负载均衡器链,其中外部负载均衡器将指向内部负载均衡器,但这也是不可能的,因为内部负载均衡器的 IP 地址是保留 IP.

I was thinking of creating the chain of load balancer in which External load balancer will point to internal load balancer but that too is not possible as the IP address of the internal load balancer is reserved IP.

我可以尝试其他方式将流量从互联网路由到 Pod 吗?

Can I try some other way to route the traffic from the internet to pod?

推荐答案

我遇到了同样的问题,这是因为我没有正确标记 VPC 子网:https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html

I had the same issue and it was because I did not tag the VPC subnets properly: https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html

我必须添加密钥:kubernetes.io/cluster/{eks-cluster-name} value:shared 标记到 VPC

I had to add the key: kubernetes.io/cluster/{eks-cluster-name} value: shared tag to the VPC

然后您可以使用 LoadBalancer 类型的服务创建负载均衡

Then you can create a LB using a service with the type LoadBalancer

apiVersion: v1
kind: Service
metadata:
  name: helloworld
  labels:
    app: helloworld
spec:
  ports:
  - port: 80
    targetPort: 8080
  selector:
    app: helloworld
  type: LoadBalancer

这可能在服务创建过程中有所帮助:https://blog.giantswarm.io/load-balancer-service-use-cases-on-aws/

This might help during the service creation: https://blog.giantswarm.io/load-balancer-service-use-cases-on-aws/

这篇关于私有子网中的 EKS,公共子网中的负载均衡器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆