10

I am trying to setup Application Load Balancer to forward traffic to Nginx Ingress controller in AWS. To set up Nginx Ingress controller, I am using this YML which I got it from the installation instructions.

After deployment, everything is working fine and traffic is being forwarded to EKS pods correctly. However, the above YML file is creating 'Classic Load Balancer' in aws where as I want to create 'Application Load Balancer'. I changed 'service.beta.kubernetes.io/aws-load-balancer-type: elb' to 'service.beta.kubernetes.io/aws-load-balancer-type: alb' but still it is creating classic load balancer in AWS.

Please help in setting up the desired LB. Thanks in advance.

Prerak Tiwari
  • 3,436
  • 4
  • 34
  • 64
  • just interested if you have tried to install nginx ingress via helm chart + specify `service.beta.kubernetes.io/aws-load-balancer-type: alb` annotation like [here](https://www.shogan.co.uk/how-tos/useful-nginx-ingress-controller-configurations-for-kubernetes-using-helm/) ? – Vit Oct 07 '20 at 09:51
  • Thanks for the pointer. I haven't tried installing it with helm. I will try and update you. – Prerak Tiwari Oct 07 '20 at 11:28
  • I tried with the helm chart..it is still creating classic alb. – Prerak Tiwari Oct 08 '20 at 04:36

3 Answers3

3

If you want to use ALB (Application Load Balancer) instead of NLB (Network Load Balancer), you need to use AWS ALB Ingress Controller with External DNS, not the NGINX Ingress Controller. See the details in this official doc and this official AWS ALB Ingress Controller doc

I hope that answers your problems.

jfmercer
  • 3,641
  • 3
  • 29
  • 35
kholisrag
  • 353
  • 2
  • 13
  • 1
    I setup ALB Ingress Controller initially, but since it does not support namespace based routing, I had to move away from it. The problem I am facing is when I am deploying ingress controller it is creating Classic LB instead of Application LB. – Prerak Tiwari Oct 08 '20 at 04:35
  • well afaik, all ingress controller execpt alb-ingress-controller is using classic nlb , not supported with alb – kholisrag Oct 10 '20 at 16:56
  • I assumed the same but I couldn't find anything related to this in documentation. Do you know if this is documented somewhere? – Prerak Tiwari Oct 12 '20 at 06:16
  • don't know thought... just based on my experience... – kholisrag Oct 12 '20 at 17:34
  • Hi @PrerakTiwari can you elaborate on what you mean my namespace based routing — for example, do you mean defining Ingress rules in namespace `foo` and routing to services in namespaces `bar`, `baz` and so on? – Darragh Enright Jan 05 '22 at 12:50
-1

It's OK when i use this method of installation : kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.40.2/deploy/static/provider/aws/deploy.yaml

DevOpsAddict
  • 61
  • 2
  • 6
-3

same issue for me with :

resource "helm_release" "ingress-nginx" {
  name       = "ingress-nginx"
  namespace  = "ingress-nginx"
  repository = "https://kubernetes.github.io/ingress-nginx"
  chart      = "ingress-nginx"
  values = [
    file("values/ingress-nginx.values.yaml")
  ]
}
controller:
  config:
    use-proxy-protocol: "true"
    use-forwarded-headers: "true"
  service:
    internal:
      annotations:
        service.beta.kubernetes.io/aws-load-balancer-backend-protocol: tcp
        service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled: 'true'
        service.beta.kubernetes.io/aws-load-balancer-proxy-protocol: '*'
        service.beta.kubernetes.io/aws-load-balancer-type: nlb
      externalTrafficPolicy: Local
DevOpsAddict
  • 61
  • 2
  • 6