aws / aws-app-mesh-examples

AWS App Mesh is a service mesh that you can use with your microservices to manage service to service communication.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] k8s ingress example loadbalancer not working on fargate

CarwynNelson opened this issue · comments

Describe the bug
I am trying to deploy the k8s-ingress-gateway example to my cluster to see if ingress via an appmesh gateway and NLB would work.

When my loadbalancer comes up I get the following error, in two different forms:

form 1:

Error syncing load balancer: failed to ensure load balancer: error creating listener: "error registering targets for load balancer: \"ValidationError: Targets must be specified\\n\\tstatus code: 400, request id: 81194c5a-94e2-4634-b574-d4b43e0b5b10\""

form 2:

Error updating load balancer with new hosts map[fargate-ip-192-168-105-114.eu-west-1.compute.internal:{} fargate-ip-192-168-109-73.eu-west-1.compute.internal:{} fargate-ip-192-168-113-122.eu-west-1.compute.internal:{} fargate-ip-192-168-122-19.eu-west-1.compute.internal:{} fargate-ip-192-168-134-199.eu-west-1.compute.internal:{} fargate-ip-192-168-137-14.eu-west-1.compute.internal:{} fargate-ip-192-168-138-47.eu-west-1.compute.internal:{} fargate-ip-192-168-145-241.eu-west-1.compute.internal:{} fargate-ip-192-168-163-19.eu-west-1.compute.internal:{} fargate-ip-192-168-163-218.eu-west-1.compute.internal:{} fargate-ip-192-168-168-22.eu-west-1.compute.internal:{} fargate-ip-192-168-178-18.eu-west-1.compute.internal:{} fargate-ip-192-168-186-124.eu-west-1.compute.internal:{} fargate-ip-192-168-189-77.eu-west-1.compute.internal:{} fargate-ip-192-168-96-132.eu-west-1.compute.internal:{}]: error registering targets for load balancer: "ValidationError: Targets must be specified\n\tstatus code: 400, request id: 1a2a5c6e-fb50-4123-af7a-bec93bce9b79"

I'm wondering if this is because I am deploying to fargate?

Platform
EKS

To Reproduce
Steps to reproduce the behavior:

  1. Setup your cluster to deploy to fargate for the example
eksctl create fargateprofile --name howto-k8s-ingress-gateway --namespace howto-k8s-ingress-gateway --cluster $CLUSTER_NAM
  1. Deploy the example to your cluster
  2. Run kubectl describe svc ingress-gw and see the errors.

Expected behavior
I expected the load balancer to boot and for my routes to be accessible.

Additional context
I tried to do this with my own application but encountered the same error, so I decided to run the example to see if that would also work, and it did not.

I finally had a chance to launch a new Kubernetes cluster that uses normal EC2 worker nodes and it worked there, so I think the issue is that AppMesh + Fargate + Load Balancers do not play well.

@CarwynNelson
You will have to use
1. nlb-ip type for your Network Loadbalancer service when using Fargate
2. Install the AWS load balancer controller which supports the NLB IP type
3. I tried the sample application on this page with Fargate and was able to see the expected result.

@CarwynNelson Any updates ? Were you able to get it working ?

@cgchinmay Sorry, just saw your message.

I have been doing this in my 10% R&D time in work, so I basically haven't looked at this since I raised the issue. I'm not sure I would have the time to sit down and reproduce the bug and try and alternatives, so you might want to close the issue.

Apologies for that.

@CarwynNelson Closing this issue as I was able to get it working with the steps I mentioned above. If you face error in future with the above steps, feel free to reopen the issue. Thanks