Application Load Balancer not registering ECS Fargate tasks automatically

0

Hi, we are developing a Dockerized web application and deploying to an ECS Fargate cluster. Here's what we have until now:

  1. An ECS Fargate service that is deployed on a public (for now) subnet.
  2. A target group using protocol HTTP on port 8080.
  3. An Application Load Balancer with the target group above as a listener also deployed on a public subnet.
  4. The security groups of the Load Balancer and ECS allowing everything (again, for now).

When ECS starts a task, I can get its private IP address and manually register to the target group and it works perfectly fine including the health checks and everything. My requests to the load balancer from my local machine are forwarded to the ECS tasks successfully, and I receive the expected responses.

The problem is the automatic registry of the ECS tasks within the target group. If I understand correctly, the target group should discover and register new tasks on the service automatically. Unfortunately it doesn't, I have to do that manually.

Why isn't it being added automatically? What am I missing here? Can you give me a hint on where to start diagnosing that?

Thank you for your time.

Edit: The problem was that the load balancer wasn't added to the ECS service itself. Once added, everything worked as expected.

2 Risposte
0
Risposta accettata

The problem was that the load balancer wasn't added to the ECS service itself. Once added, everything worked as expected.

con risposta un anno fa
  • Just as I said. Define the load balancer when setting up the ecs service.

0

Please ensure you create an Target Group of Instance type. When you register your ECS service in the ECS console, you define the load balancer and target group to use

When your ECS Servive starts, it registers its self in the target group

Sounds like your using a IP type target group?

profile picture
ESPERTO
con risposta un anno fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande