-
Notifications
You must be signed in to change notification settings - Fork 7
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
Allow setting consul client url in mesh-init #91
Comments
Hi, @guoqikai! Thanks for the issue. Can you share more about your configuration? Are you using the EC2 or Fargate launch type with ECS? Where are you running the Consul client? |
Hi @pglass, Thanks for following up! We are using the EC2 launch type and the consul client is running as a daemon service in host network mode. The consul client is listening on the docker0 interface so other containers should be able to reach it via docker.internal.host:8500. |
@guoqikai Thanks! You can try setting the However, if you are using the Terraform I also have a few more questions.
Thank you! |
@pglass Thanks!
|
👍
I'm wondering if you could explain this a little more: Why is host network mode necessary? Are you running one task which listens on ~10000 ports? Or are you running ~10000 tasks which each listens on a unique port? The Thanks for all the info, too. This is really helpful for us. |
@pglass The streaming task needs to open ~10000 ports. The awsvpc network mode still requires us to expose all the require ports in port mapping and there's a limit on how many ports a single task can expose, while the host mode exposes all ports implicitly. You can check out this issue for more details aws/containers-roadmap#194 |
Ah, so it's my understanding that if your service binds to the task IP address (or 0.0.0.0), then you don't need any port mappings in AWS VPC mode. (If the service listens on only localhost, then the port mappings are required.) This is how we start both Envoy and Consul client in AWS VPC mode, by binding directly to the task IP (terraform example - there are no port mappings listed and, it's not obvious, but Envoy binds to |
@pglass |
Right, understood. To clarify, if your service binds to the task IP (or 0.0.0.0) in AWS VPC mode, then any port the service listens on is reachable outside the task, without needing port mappings in the task definition. |
Wow thanks! I've never tried this and there're tons of posts suggest that only ports specified in port mapping can be reachable... I was following the ecs-consul-mesh-extension implementation and they include port 20000 in port mapping of the envoy proxy. |
Glad to be able to help! That AWS CDK construct is based on an older version of our For the future, we're looking at alleviating the need for a Consul client container per task. Back to the original issue, let us know how setting |
Gotcha! Thanks for the support! |
Description
Currently for the mesh-init comand, the consul client url is always set to 127.0.0.1:8500.
However in our use case the client is listening on a different ip address
Use Cases
Sharing a consul client across multiple ecs tasks
Alternative Solutions
There's no alternative solutions
Additional context
IMO simply adding cfg.Address = config.ClientAddress on line 64 and update the connect envoy command accordingly should do the job
The text was updated successfully, but these errors were encountered: