简体   繁体   中英

Registering an ELB to an ECS service with random host port

I'm working with the ECS service on AWS and I have this problem - the docker containers I need to run on ECS are webservices, each container should have its internal port 80 mapped to a random port on the container host. I don't want to specify the host port for the 80 container port beforehand, I'd like to let docker daemon to find a host port for the container.

But, how the ELB fits here? For me it looks that I have to know the host port to be able to create the ELB for the service.

Is it so?

This is now possible using Application load balancer

However, if you need to open up inbound traffic on the security group, security group's port mapping is not updated automatically.

ELB does not allow binding to random port.

We have recently implemented service discovery with ECS and CONSUL. We had to introduce Zuul as intermediate layer between the ELB and our apps.

ELB maps to zuul on a static port, but Zuul discovers the backend services dynamically and routes traffic.

您需要一个服务发现系统,例如Hashicorp的Consul ,然后您需要将其与AWS基础架构集成: https//aws.amazon.com/blogs/compute/service-discovery-via-consul-with-amazon-ecs/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM