<p>I'm trying to deploy an Application Load Balancer to AWS using Terraform's <code>kubernetes_ingress</code> resource:</p>
<p>I'm using <a href="https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.3/" rel="nofollow noreferrer">aws-load-balancer-controller</a> which I've installed using <code>helm_release</code> resource to my cluster.</p>
<p>Now I'm trying to deploy a <code>deployment</code> with a <code>service</code> and <code>ingress</code>.</p>
<p>This is how my <code>service</code> looks like:</p>
<pre><code>resource &quot;kubernetes_service&quot; &quot;questo-server-service&quot; {
  metadata {
    name      = &quot;questo-server-service-${var.env}&quot;
    namespace = kubernetes_namespace.app-namespace.metadata.0.name
  }
  spec {
    selector = {
      &quot;app.kubernetes.io/name&quot; = lookup(kubernetes_deployment.questo-server.metadata.0.labels, &quot;app.kubernetes.io/name&quot;)
    }

    port {
      port        = 80
      target_port = 4000
    }
    type = &quot;LoadBalancer&quot;
  }
}
</code></pre>
<p>And this is how my <code>ingress</code> looks like:</p>
<pre><code>resource &quot;kubernetes_ingress&quot; &quot;questo-server-ingress&quot; {
  wait_for_load_balancer = true
  metadata {
    name = &quot;questo-server-ingress-${var.env}&quot;
    namespace = kubernetes_namespace.app-namespace.metadata.0.name
    annotations = {
      &quot;kubernetes.io/ingress.class&quot; = &quot;alb&quot;
      &quot;alb.ingress.kubernetes.io/target-type&quot; = &quot;instance&quot;
    }
  }
  spec {
    rule {
      http {
        path {
          path = &quot;/*&quot;
          backend {
            service_name = kubernetes_service.questo-server-service.metadata.0.name
            service_port = 80
          }
        }
      }
    }
  }
}
</code></pre>
<p>The issue is that when I run <code>terraform apply</code> it creates a Classic Load Balancer instead of an Application Load Balancer.</p>
<p>I've tried changing <code>service</code>'s type to <code>NodePort</code> but it didn't help.</p>
<p>I've also tried with adding more annotations to <code>ingress</code> like <code>&quot;alb.ingress.kubernetes.io/load-balancer-name&quot; = &quot;${name}&quot;</code> but then the it created two load balancers at once! One internal ALB and one internet facing CLB.</p>
<p>Any ideas how I can create an internet facing Application Load Balancer using this setup?</p>
<p>--- Update ----</p>
<p>I've noticed, that actually, the <code>service</code> is the Classic Load Balancer via which I can connect to my <code>deployment</code>.</p>
<p>Ingress creates an ALB, but it's prefixed with <code>internal</code>, so my questions here is, how to create an internet facing ALB?</p>
<p>Thanks!</p>

<p>Try using the <code>alb.ingress.kubernetes.io/scheme: internet-facing</code> annotation.</p>
<p>You find a list of all available annotations here: <a href="https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.2/guide/ingress/annotations/" rel="nofollow noreferrer">https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.2/guide/ingress/annotations/</a></p>
