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.

답변함 일 년 전
  • 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
전문가
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠