我在私有(private)子网中运行 EKS,因此无法创建面向 Internet 的负载均衡器,但能够创建内部负载均衡器。
有什么方法可以在公共(public)子网中创建负载平衡器(可能是手动)并指向私有(private)子网中在 EKS 中运行的 pod。
我正在考虑创建负载均衡器链,其中外部负载均衡器将指向内部负载均衡器,但这也是不可能的,因为内部负载均衡器的 IP 地址是保留 IP。
我可以尝试其他方式将流量从互联网路由到 Pod 吗?
最佳答案
我遇到了同样的问题,这是因为我没有正确标记 VPC 子网:
https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html
我必须将 key :kubernetes.io/cluster/{eks-cluster-name} value: shared tag 添加到 VPC
然后您可以使用类型为 LoadBalancer 的服务创建 LB
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/
关于kubernetes-ingress - 私有(private)子网中的 EKS,公共(public)子网中的负载均衡器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54027386/