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] [request]: Valid SRV qname for service discovery #448

Open
sveniu opened this issue Aug 27, 2019 · 5 comments
Open

[ECS] [request]: Valid SRV qname for service discovery #448

sveniu opened this issue Aug 27, 2019 · 5 comments
Labels
Docs Things to be added or updated in the documentation ECS Amazon Elastic Container Service Proposed Community submitted issue

Comments

@sveniu
Copy link

sveniu commented Aug 27, 2019

Tell us about your request
Add option to use the RFC 2782-compliant _service._proto.namespace SRV record qname format for ECS / Cloud Map. Currently the SRV qname format is identical to the A record format: service.namespace.

Which service(s) is this request for?
ECS, Cloud Map (aka Service Discovery)

Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?
I'm trying to use HAProxy with ECS tasks as backends, but HAProxy will only try SRV resolution if the qname starts with an underscore. Therefore, the SRV records produced by ECS / Cloud Map cannot be used with HAProxy (or other services that rely on the spec format).

Are you currently working around this issue?
The current work-around is to rely solely on A records, and to be very vigilant with DNS caching, re-lookups, etc.

@sveniu sveniu added the Proposed Community submitted issue label Aug 27, 2019
@jtoberon jtoberon added the ECS Amazon Elastic Container Service label Sep 11, 2019
@coultn
Copy link

coultn commented Sep 11, 2019

Is there a reason why just naming your service in Cloud Map according to the RFC 2782 format won't work? There is no requirement that the service name in Cloud Map be the same as the name of the ECS service. So for example if your Cloud Map zone is .local, you can name your service _myservice._tcp and it will be DNS-resolvable as _myservice._tcp.local. This works with SRV records also. Please let me know if there is something I am misunderstanding!

@eedwards-sk
Copy link

Is there a reason why just naming your service in Cloud Map according to the RFC 2782 format won't work?

I just spent all night chasing down the same issue, and I can confirm that this is a valid workaround.

Perhaps it would be best to surface this somewhere in the documentation? I never, ever would have thought to just put the appropriate values directly into the service name.

@shubharao shubharao added the Docs Things to be added or updated in the documentation label Oct 14, 2019
@TamasNo1
Copy link

I actually spend the night as well trying to find out why HAProxy does not resolve my SRV records generated by ECS service discovery, and yepp, it's the missing underscore prefix... After prefixing my service name with an underscore, it works perfectly.

@coultn
Copy link

coultn commented Jan 2, 2020

FYI, we have added this to our documentation: https://docs.aws.amazon.com/cloud-map/latest/dg/services-values.html

@mattjamesaus
Copy link

I will add here that cloudmap / route 53 only returns at maximum 8 records which means HAProxy will remove instances from the pool when route 53 returns a different 8 IPs each time. (assuming you have more than 8 containers for one service)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Things to be added or updated in the documentation ECS Amazon Elastic Container Service Proposed Community submitted issue
Projects
None yet
Development

No branches or pull requests

7 participants