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回答
0
承認された回答

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

回答済み 1年前
  • 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
エキスパート
回答済み 1年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン