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

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

问题描述

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

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} 值: shared 标记添加到VPC

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

然后,您可以使用类型为LoadBalancer的服务来创建LB

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天全站免登陆