mon
mon

Reputation: 22234

Is AWS NLB supported for ECS?

Question

Is NLB supported for ECS with dynamic port mapping?

Background

It looks there are attempts to use NLB with ECS but problems with health check.

When talked with AWS, they acknowledged that the NLB documentation of health check interval is not accurate as NLB has multiple instances sending health check respectively, hence the interval when an ECS task will get health check is not according to the HealthCheckIntervalSeconds.

Also the ECS task page says specifically about ALB to use the dynamic port mapping.

enter image description here

Hence, I suppose NLB is not supported for ECS? If there is a documentation which states NLB is supported for ECS, please suggest.


Update

Why are properly functioning Amazon ECS tasks registered to ELB marked as unhealthy and replaced?

Elastic Load Balancing is repeatedly flagging properly functioning Amazon Elastic Container Service (Amazon ECS) tasks as unhealthy. These incorrectly flagged tasks are stopped and new tasks are started to replace them. How can I troubleshoot this?

change the Health check grace period to an appropriate time period for your service

Upvotes: 3

Views: 6422

Answers (2)

Venkat S
Venkat S

Reputation: 43

You need to create a Network Target Group, Attach the ECS/Fargate Service to the Network Target Group. On the Network Target Group you should be able to specify the health check method, You can configure the Health URL and Protocol

An example of this is available @ https://github.com/go-fireball/cdk-examples/tree/main/nlb-fargate

Upvotes: 1

Mayank Vaishnav
Mayank Vaishnav

Reputation: 1

A Network Load Balancer makes routing decisions at the transport layer (TCP/SSL). It can handle millions of requests per second. After the load balancer receives a connection, it selects a target from the target group for the default rule using a flow hash routing algorithm. It attempts to open a TCP connection to the selected target on the port specified in the listener configuration. It forwards the request without modifying the headers. Network Load Balancers support dynamic host port mapping.

https://docs.aws.amazon.com/AmazonECS/latest/developerguide/load-balancer-types.html#nlb

Upvotes: -6

Related Questions