title: AWS EKS Fargate Ingress Has No Address
body: <p><strong>Updated</strong></p>
  
  <p>So, I followed the <a href="https://docs.aws.amazon.com/eks/latest/userguide/fargate-getting-started.html" rel="nofollow noreferrer">AWS docs</a> on how to setup an EKS cluster with Fargate using the <a href="https://eksctl.io/usage/fargate/" rel="nofollow noreferrer">eksctl</a> tool. That all went smoothly but when I get to the part where I deploy my actual app, I get no endpoints and the ingress controller has no address associated with it. As seen here:</p>
  
  <pre><code>NAME                     HOSTS   ADDRESS   PORTS   AGE
  testapp-ingress           *                 80      129m
  </code></pre>
  
  <p>So, I can't hit it externally. But the test app (2048 game) had an address from the elb associated with the ingress. I thought it might be the subnet-tags as suggested <a href="https://github.com/kubernetes-sigs/aws-alb-ingress-controller/issues/771#issuecomment-444965502" rel="nofollow noreferrer">here</a> and my subnets weren't tagged the right way so I tagged them the way suggested in that article. Still no luck. </p>
  
  <p>This is the initial article I followed to get set up. I've performed all the steps and only hit a wall with the alb: <a href="https://docs.aws.amazon.com/eks/latest/userguide/fargate-getting-started.html#fargate-gs-next-steps" rel="nofollow noreferrer">https://docs.aws.amazon.com/eks/latest/userguide/fargate-getting-started.html#fargate-gs-next-steps</a></p>
  
  <p>This is the alb article I've followed: <a href="https://docs.aws.amazon.com/eks/latest/userguide/alb-ingress.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/eks/latest/userguide/alb-ingress.html</a></p>
  
  <p>I followed the steps to deploy the sample app 2048 and that works just fine. I've made my configs very similar and it should work. I've followed all of the steps. Here are my <strong>old</strong> configs, new config below:</p>
  
  <pre><code>deployment yaml&gt;&gt;&gt;
  ---
  apiVersion: apps/v1
  kind: Deployment
  metadata:
    name: "testapp-deployment"
    namespace: "testapp-qa"
  spec:
    selector:
      matchLabels:
        app: "testapp"
    replicas: 5
    template:
      metadata:
        labels:
          app: "testapp"
      spec:
        containers:
        - image: xxxxxxxxxxxxxxxxxxxxxxxxtestapp:latest
          imagePullPolicy: Always
          name: "testapp"
          ports:
          - containerPort: 80
  ---
  service yaml&gt;&gt;&gt;
  apiVersion: v1
  kind: Service
  metadata:
    name: "testapp-service"
    namespace: "testapp-qa"
  spec:
    ports:
      - port: 80
        targetPort: 80
        protocol: TCP
        name: http
    type: NodePort
    selector:
      app: "testapp"
  ---
  ingress yaml &gt;&gt;&gt;
  apiVersion: extensions/v1beta1
  kind: Ingress
  metadata:
    name: "testapp-ingress"
    namespace: "testapp-qa"
    annotations:
      kubernetes.io/ingress.class: alb
      alb.ingress.kubernetes.io/scheme: internet-facing
    labels:
      app: testapp-ingress
  spec:
    rules:
      - http:
          paths:
            - path: /*
              backend:
                serviceName: "testapp-service"
                servicePort: 80
  ---
  namespace yaml&gt;&gt;&gt;
  apiVersion: v1
  kind: Namespace
  metadata:
    name: "testapp-qa"
  </code></pre>
  
  <p>Here are some of the logs from the ingress controller>></p>
  
  <pre><code>E0316 22:32:39.776535       1 controller.go:217] kubebuilder/controller "msg"="Reconciler error" "error"="failed to reconcile targetGroups due to failed to reconcile targetGroup targets due to Unable to DescribeInstanceStatus on fargate-ip-xxxxxxxxxxxx.ec2.internal: InvalidInstanceID.Malformed: Invalid id: \"fargate-ip-xxxxxxxxxxxx.ec2.internal\"\n\tstatus code: 400, request id: xxxxxxxxxxxx"  "controller"="alb-ingress-controller" "request"={"Namespace":"testapp-qa","Name":"testapp-ingress"}
  E0316 22:36:28.222391       1 controller.go:217] kubebuilder/controller "msg"="Reconciler error" "error"="failed to reconcile targetGroups due to failed to reconcile targetGroup targets due to Unable to DescribeInstanceStatus on fargate-ip-xxxxxxxxxxxx.ec2.internal: InvalidInstanceID.Malformed: Invalid id: \"fargate-ip-xxxxxxxxxxxx.ec2.internal\"\n\tstatus code: 400, request id: xxxxxxxxxxxx"  "controller"="alb-ingress-controller" "request"={"Namespace":"testapp-qa","Name":"testapp-ingress"}
  </code></pre>
  
  <hr>
  
  <p>Per the suggestion in the comments from @Michael Hausenblas, I've added an annotation to my service for the alb ingress. </p>
  
  <p>Now that my ingress controller is using the correct ELB, I checked the logs because I still can't hit my app's <code>/healthcheck</code>. The logs:</p>
  
  <pre><code>E0317 16:00:45.643937       1 controller.go:217] kubebuilder/controller "msg"="Reconciler error" "error"="failed to reconcile targetGroups due to failed to reconcile targetGroup targets due to Unable to DescribeInstanceStatus on fargate-ip-xxxxxxxxxxx.ec2.internal: InvalidInstanceID.Malformed: Invalid id: \"fargate-ip-xxxxxxxxxxx.ec2.internal\"\n\tstatus code: 400, request id: xxxxxxxxxxx-3a7d-4794-95fb-a18835abe0d3"  "controller"="alb-ingress-controller" "request"={"Namespace":"testapp-qa","Name":"testapp"}
  I0317 16:00:47.868939       1 rules.go:82] testapp-qa/testapp-ingress: modifying rule 1 on arn:aws:elasticloadbalancing:us-east-1:xxxxxxxxxxx:listener/app/xxxxxxxxxxx-testappqa-testappin-b879/xxxxxxxxxxx/6b41c0d3ce97ae6b
  I0317 16:00:47.890674       1 rules.go:98] testapp-qa/testapp-ingress: rule 1 modified with conditions [{    Field: "path-pattern",    Values: ["/*"]  }]
  </code></pre>
  
  <hr>
  
  <p><strong>Update</strong></p>
  
  <p>I've updated my config. I don't have any more errors but still unable to hit my endpoints to test if my app is accepting traffic. It might have something to do with fargate or on the AWS side I'm not seeing. Here's my updated config:</p>
  
  <pre><code>---
  apiVersion: apps/v1
  kind: Deployment
  metadata:
    name: "testapp"
    namespace: "testapp-qa"
  spec:
    selector:
      matchLabels:
        app: "testapp"
    replicas: 5
    template:
      metadata:
        labels:
          app: "testapp"
      spec:
        containers:
        - image: 673312057223.dkr.ecr.us-east-1.amazonaws.com/wood-testapp:latest
          imagePullPolicy: Always
          name: "testapp"
          ports:
          - containerPort: 9898
  ---
  apiVersion: v1
  kind: Service
  metadata:
    name: "testapp"
    namespace: "testapp-qa"
    annotations: 
      alb.ingress.kubernetes.io/target-type: ip
  spec:
    ports:
      - port: 80
        targetPort: 9898
        protocol: TCP
        name: http
    type: NodePort
    selector:
      app: "testapp"
  ---
  apiVersion: extensions/v1beta1
  kind: Ingress
  metadata:
    name: "testapp-ingress"
    namespace: "testapp-qa"
    annotations:
      kubernetes.io/ingress.class: alb
      alb.ingress.kubernetes.io/scheme: internet-facing
      alb.ingress.kubernetes.io/healthcheck-path: /healthcheck
    labels:
      app: testapp
  spec:
    rules:
      - http:
          paths:
            - path: /*
              backend:
                serviceName: "testapp"
                servicePort: 80
  ---
  apiVersion: v1
  kind: Namespace
  metadata:
    name: "testapp-qa"
  </code></pre>