简体   繁体   中英

How to connect an AWS Load Balancer to nginx ingress controller with Kubernetes deployed on EC2 with kubeadm?

I have installed Kubernetes Cluster on AWS using kubeadm. I understand that it will not fall under AWS Deployment. I am trying to follow the baremetal fashion of installing Kubernetes.

Everything works fine for Nodeport, I want to know if I can connect an AWS Load Balancer to this setup, If yes, how?

I've thoroughly researched online and found this solution where in we can specify an external IP address to a service. But, Load Balancers do not have IP addresses.

I am using Nginx Ingress Controller, everything works fine on ClusterIP, how can I expose the application using AWS Load Balancer?

Can anyone help?

Use the following approach to integrate aws-load-balancer with nginx-ingress-controller running in kubernetes cluster created/running on EC2

Step 1: Setup/Install "nginx-ingress-controller"

Step 2: Create a extra service to expose "nginx-ingress-controller" on fix ports with NodePort . See below screenshot highlighted in yellow

nginx-ingress-controller 作为 NodePort Kubernetes 的外部服务

Extra service to expose "nginx-ingress-controller" externally will look like following if you installed "nginx-ingress-controller" in "kube-system" namespace using helm

nginx-ingress-controller 的 Helm 列表

在 NodePort 上对外公开 nginx-ingress-controller 的额外服务

Step 3: Go to Load Balancers Section in EC2 from AWS Console ,

then Create Load Balancer, for Simplicity choose "Classic Load Balancer's Create Button"

AWS 经典负载均衡器设置

Setup Ports and Protocol configuration as Below

AWS Classic 负载均衡器端口和协议配置

Then Assign your Security group , Configure health check for instances,

Finally Add your cluster Instances from list , Add tags and finally review and click create done.

Visit the LB's DNS Name , you will find your "nginx-ingress-controller" exposed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM