Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ECS support for multiple target groups per service #12

Closed
abby-fuller opened this issue Nov 28, 2018 · 18 comments
Closed

ECS support for multiple target groups per service #12

abby-fuller opened this issue Nov 28, 2018 · 18 comments
Labels
ECS Amazon Elastic Container Service Fargate AWS Fargate

Comments

@abby-fuller
Copy link
Contributor

Customers leverage same service for multiple endpoints and would therefore like to be able to put the same service behind multiple load balancers or target groups. There is also a scale aspect where the ECS service could scale beyond what a single load balancer can handle by default.

@abby-fuller abby-fuller created this issue from a note in containers-roadmap (We're Working On It) Nov 28, 2018
@abby-fuller abby-fuller added the ECS Amazon Elastic Container Service label Nov 28, 2018
@coultn coultn changed the title Support multiple load balancers per service Support multiple target groups per service Dec 5, 2018
@coultn coultn added the Fargate AWS Fargate label Dec 5, 2018
@coultn
Copy link

coultn commented Dec 5, 2018

This will address https://github.com/aws/amazon-ecs-agent/issues/1351.

@Akramio Akramio changed the title Support multiple target groups per service ECS support for multiple target groups per service Dec 5, 2018
@jespersoderlund
Copy link

Just making sure that the Fargate label doesn't mean that it's only for Fargate as there are plenty of uses in ECS on EC2 as well

@tlwr
Copy link

tlwr commented Jan 16, 2019

We have the requirement of static IPs in front of our ALB but we don't want to follow the guidance of this AWS blog post because it seems like a hack.

Instead we have:

  • Static IP NLB
  • Routes traffic to haproxy containers
  • TCP forwards to ALB
  • ALB does TLS termination, redirects, path based routing, etc

This is still a hack but a slightly more observable hack, though, in order to use the nice ALB redirect (HTTP -> HTTPS 301) feature we have to run two ECS Services because a Service only supports one target group. There are potentially other ways around this problem but this is the one which we have chosen.

This feature would be extremely good.

@franciscodiazydiaz
Copy link

We need this feature to split internal and external traffic in different Load Balancers but using the same container instance.

@m-barthelemy
Copy link

The original issue #104 was opened 1 year ago. Any news?

@barrytam20
Copy link

we thought about using app mesh for internal traffic and load balancers for external, but since we do not have very many services, setting up app mesh seemed like overkill.

however, if you have a lot of services talking to each other, app mesh seems like a good solution

@anshul0915zinnia
Copy link

We need this feature to split internal and external traffic in different Load Balancers but using the same container instance.

@akshayram-wolverine akshayram-wolverine moved this from We're Working On It to Coming Soon in containers-roadmap Jun 24, 2019
@daaru00
Copy link

daaru00 commented Jul 2, 2019

We are trying to deploy a Node.js service with express routing + websocket listener, as a basic configuration it expose 2 ports.

There's an ETA about this feature release? Just to know if we have to implements a workaround, refactor the application (splitting HTTP and WS) or waiting for this feature.

Thank you

@franciscodiazydiaz
Copy link

It's in preview (:
https://github.com/aws/containers-roadmap/tree/master/preview-programs/ecs-multipletg-service

@akshayram-wolverine akshayram-wolverine moved this from Coming Soon to Just Shipped in containers-roadmap Jul 30, 2019
@akshayram-wolverine
Copy link
Contributor

Shipped! Learn more here: https://aws.amazon.com/about-aws/whats-new/2019/07/amazon-ecs-services-now-support-multiple-load-balancer-target-groups/

@iniinikoski
Copy link

iniinikoski commented Jul 30, 2019 via email

@coultn coultn closed this as completed Jul 31, 2019
@chrobotm
Copy link

can't see anything new on the cloudformation changelog page - what happened to that?

@swlasse
Copy link

swlasse commented Jul 31, 2019

I'm not sure any changes to CloudFormation is needed? I just tried this out, and the support for declaring multiple LoadBalancers are already available in the AWS::ECS::Service resource - see: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-loadbalancers

This enables us to work with multiple loadbalancers / target groups exactly as in the examples from the docs: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/register-multiple-targetgroups.html

Thanks to the ECS team for adding this support - it works great :)

@chrobotm
Copy link

thanks, yeah that was there ages ago but it didn't work when I tried it before. Was expecting something to show up on the cfn changelog

@swlasse
Copy link

swlasse commented Jul 31, 2019

Yeah, exactly. That property has been around for a while, the only difference now being that it is possible to add more elements than one. If I remember correctly, doing that prior to this release, caused the CloudFormation stack to fail during creation with an error similar to: "load balancers can have at most 1 items".

But yeah, one could argue that the CFN changelog could contain an entry mentioning that this restriction has now been relaxed.

@chrobotm
Copy link

cfn doesn't work for me

You cannot specify an IAM role for services that require a service linked role. (Service: AmazonECS; Status Code: 400; Error Code: InvalidParameterException;

can do it for one target group but not two

@dcelasun
Copy link

You need to remove the Role section from AWS::ECS::Service and it'll work.

@wbingli
Copy link

wbingli commented Jul 31, 2019

@mbotmcc The multiple target groups requires to use ECS service linked role, it will enhance the service role management for free. See IAM SLR

Remove the Role for the ECS service, it will use service linked role by default. And you can also remove the entire section to create service role for ECS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ECS Amazon Elastic Container Service Fargate AWS Fargate
Projects
Development

No branches or pull requests