EKS in private Subnet , Load Balancer in public subnet

别等时光非礼了梦想. 提交于 2019-12-09 15:52:32

问题


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

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.

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.

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


回答1:


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

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

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

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



来源:https://stackoverflow.com/questions/54027386/eks-in-private-subnet-load-balancer-in-public-subnet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!