Use Application Load Balancers | Helm chart | AWS

2/15/2021

I have deployed an application on AWS using EKS. I roughly need 20-25 loadbalancers in my application.

Now, AWS offers 20 Classic load balancers and 50 Application load balancers in my account.

I use helm chart for creating these load balancers using service => type => LoadBalancer, and these loadbalancers are considered Classic load balancers.

Is there a way to use ALB in place of CLB (either using AWS settings OR passing an option in the helm chart) ?

Thanks in advance !

-- Keval Bhogayata
amazon-eks
aws-load-balancer
kubernetes
kubernetes-helm

1 Answer

2/15/2021

According to AWS ELB documentation, You can use following ingress annotation for ingress object:

annotations:
    kubernetes.io/ingress.class: alb

From AWS docs:

The AWS Load Balancer Controller creates ALBs and the necessary supporting AWS resources whenever a Kubernetes Ingress resource is created on the cluster with the kubernetes.io/ingress.class: alb annotation. The Ingress resource configures the ALB to route HTTP or HTTPS traffic to different pods within the cluster. To ensure that your Ingress objects use the AWS Load Balancer Controller, add the following annotation to your Kubernetes Ingress specification. For more information, see Ingress specification on GitHub.

What's good in this solution is that an ALB can also be shared across multiple Ingresses, so you wouldn't need to use so many of separete LBs.

EDIT: As mentioned by Bastian, You need to have AWS Load Balancer Controller deployed to your cluster in order for it to work.

-- Matt
Source: StackOverflow