hashicorp / go-discover

Discover nodes in cloud environments
Mozilla Public License 2.0
560 stars 122 forks source link

Add support for DNS discovery #185

Open prologic opened 2 years ago

prologic commented 2 years ago

Hi all 👋

Whilst there is the mDNS provider, but there isn't currently a plain DNS provider. This is primarily useful (at least for me) in a Docker Swarm cluster (yes these are still in use!)

Is there any interest in this from the community?

mr-miles commented 2 years ago

I'd love to see this merged in.

At the moment we have a mix of on-prem windows and aws windows+linux consul agents that want to discover the address of consul servers in aws that are part of an auto-scaling group. For the on-prem instances, it is really hard for them to find the addresses without hard-coding them into each agent config/more complicated certificates etc which we would like to avoid.

It would be ideal if they could resolve a CNAME that contains multiple A records to the individual elements and use that.

Will this PR ever get merged in?

prologic commented 2 years ago

That's why I built this for non-cloud environments basically. In an on-preom environment you're basically limited to either standing up something to do this for you (e.g: Consul) or using regular DNS (which is pretty common).

schoeppi5 commented 6 months ago

This could also be used in a Kubernetes cluster to resolve the DNS name of a headless service.