Empty Response Kubernetes Load Balancer

Viewed 1058

Update: it says "0 of 0 instances in service" in the Basic Configuration of my AWS Loadbalancer

I know, this is a duplicate of several other questions with the same title, but there a almost no answers, so I am asking this myself:

I have followed this tutorial to the letter (twice) https://kubernetes.io/docs/tutorials/stateless-application/expose-external-ip-address/

I use the managed kubernetes by aws based on fargate.

All I get when calling the url in the browser is an empty response. I have checked that the loadbalancer has the correct permissions and ports. Everything is fine there (all automatically setup by AWS).

I have verified that all pods are running, and that the service is running. Aditionally, this does not seem to be a problem concerning this specific tutorial and its setup. Actually I had this "empty-response"-problem with another hello-world-deployment (from the aws-tutorial) yesterday.

There seems to be something fundamentally wrong. Maybe I forgot a step in the setup of my kubernetes cluster? It is all managed though...

Thanks for any pointers!

1 Answers

When using Fargate withg an EKS cluster, you don't have access to nodes instances. this means that Fargate doesn't support CLB/NLB.

With Fargate it is recommended to use the ALB Ingress Controller

example of ingress rule:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    alb.ingress.kubernetes.io/scheme: internet-facing
    kubernetes.io/ingress.class: alb
  labels:
    app: hello-world
  name: hello-world
spec:
  rules:
  - http:
      paths:
      - backend:
          serviceName: my-service
          servicePort: 8080
        path: /*

Note: If your EKS cluster has a mix of Fargate and EC2 instances, then you'll ma able to uses the classic loadbalancing, that will first reach EC2 eks instances, then it will be forwarded to your Fargate pods using internal Kubernetes routing.

Related