How to use application load balancing for ECS with multiple port mappings?

I want to be able to use ALB (ELBv2) to route traffic for several port mappings that are displayed by the job of this service.

Example -

Service A consists of 1 task working with the definition of task B.

Task Definition B has one “Container” that internally runs two daemons on two different port numbers (port 8000 and port 9000, both TCP). Thus, the definition of task B has two ports that need to be mapped to ALB.

I'm not too worried about the ports that ALB provides (they should not be 8000 and 9000, but will help if they are).

  • my-lb-dns.com:8000 → myservice: 8000
  • my-lb-dns.com:9000 → myservice: 9000

Any ideas on creating multiple listeners and target groups to achieve this? Nothing in the console user interface allows me to do this, and the API is also not very useful.

Thank you so much!

+4
source share
1 answer

Speaking with AWS support, it seems that ECS is geared towards microservices that are expected to exhibit only one port. The presence of ECS to balance application load balancing two or more ports is not supported.

, , .., ECS , .

+8

Source: https://habr.com/ru/post/1657455/


All Articles