AWS Classic Loadbalancer dynamic port mapping for ECS

830 views Asked by At

Currently, it's not possible for one CLB to load balance two distinct TCP services running in the same multinode ECS cluster (confirmed by AWS support).

  • Does anyone know a way around that?
  • Does anyone from AWS have an approximate date (like is it weeks/months/years) for this feature (dynamic port mapping for TCP ports)?

Context: Suppose i have a custom TCP server. I would like to run this server for each customer, a single container instance per customer and have those services exposed to the outside world. Ideally ECS, for each service, would add a TCP listener in CLB that routes traffic to a specific EC2:port instace (the port pair does not matter, the important part is for it to be reachable from the outside).

Thank you

2

There are 2 answers

3
nathanpeck On BEST ANSWER

You'll be happy to know that a new type of load balancer was just released called Network Load Balancer (NLB). This should solve your problem!

https://aws.amazon.com/blogs/aws/new-network-load-balancer-effortless-scaling-to-millions-of-requests-per-second/

2
nathanpeck On

For TCP communication between services running on dynamic ports most AWS customers use thick client load balancing with a solution like linkerd, consul, or weaveworks (which provides an overlay network). You can also use DNS based service discovery.

There is a list of service discovery mechanisms that integrate well with Amazon ECS here: https://github.com/nathanpeck/awesome-ecs#service-discovery