How to create application load balancer on aws for kubernetes

Question:

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.

Answer:

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.

Leave a Reply