Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create application load balancer on aws for kubernetes

Question is similar to following SO question. But I am not looking forward to create classic load balancer.

How to create Kubernetes load balancer on aws

AWS now provide 2 types of loadbalancer, classic load balancer and application load balancer. Please read following document for more information,

https://aws.amazon.com/blogs/aws/new-aws-application-load-balancer/

I already know how classic load balancer work with kubernetes. I wonder if there is any flag/ tool exist so that we can also configure application loadbalancer.

like image 401
Balkrishna Avatar asked Sep 06 '16 13:09

Balkrishna


People also ask

Is there a load balancer in Kubernetes?

The Kubernetes load balancer sends connections to the first server in the pool until it is at capacity, and then sends new connections to the next available server. This algorithm is ideal where virtual machines incur a cost, such as in hosted environments.

Does EKS have a load balancer?

Network traffic is load balanced at L4 of the OSI model. To load balance application traffic at L7 , you deploy a Kubernetes ingress , which provisions an AWS Application Load Balancer.


2 Answers

An AWS ALB Ingress Controller has been built which you can find on GitHub: https://github.com/coreos/alb-ingress-controller

like image 85
Brandon Philips Avatar answered Oct 19 '22 03:10

Brandon Philips


I can tell you that as of K8 v1.2.3/4 there is no built-in support for Application Load Balancers.

That said, what I do is expose internally load balanced pods via a service NodePort. You can then implement any type of AWS load balancing you would like, including new Application Load Balancing features such as Content-Based Routing, by setting up your own AWS ALB that directs a URL path like /blog to a specific NodePort.

You can read more about NodePorts here: http://kubernetes.io/docs/user-guide/services/#type-nodeport

For bonus points, you could script the creation of the ALB via something like BOTO3 and have it provisioned when you provision the K8 services/pods/rc.

like image 20
Drew Avatar answered Oct 19 '22 03:10

Drew