question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add a DNS-based EndpointGroup

See original GitHub issue

Many service discovery systems support returning a list of endpoints as records in a DNS response, and since DNS resolution is built into netty, it makes sense for armeria to add support out of the box. Some methods use A records with IP addresses and others use SRV records with CNAMEs - so armeria should ideally support at least both of these.

I dug through netty’s DNS resolver package and found a lot of useful logic, but am not sure if there is a good integration point for it.

The biggest problem is I don’t see a way to support SRV records - the API only exposes knobs for address family, e.g. IPV4 and IPV6, which correspond to A and AAAA only.

https://github.com/netty/netty/blob/1767814a466f9fc6a51c87a84bd73d93eb0ca1d7/resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolver.java

I think we also need a way to always be able to know the most recent result for the DNS query for monitoring - it’s very important to be able to present the mapping from service name -> resolved endpoints, and it’s not clear this can be accomplished with the default DnsNameResolver (maybe by showing the state of the dns cache?).

That said, there’s much logic in DnsNameResolver, DnsNameResolverContext, and RoundRobinDnsAddressResolverGroup that I don’t think we want to duplicate into an endpoint group implementation.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
anuraagacommented, Jul 19, 2017

Just to follow up, I’ve mostly completed an implementation that manually handles the query response. While a good amount of copy-paste, by removing some of the more esoteric features that probably don’t apply in service discovery, I could simplify it quite a bit.

https://github.com/anuraaga/armeria/blob/dev_rag/core/src/main/java/com/linecorp/armeria/client/endpoint/dns/DnsEndpointGroup.java

0reactions
anuraagacommented, Jul 18, 2017

Yeah - I found query and am able to get DNS responses - but found there’s tons and tons of logic dealing with correctly handling the response. It would be quite sad to have to duplicate it

https://github.com/netty/netty/blob/4.1/resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolverContext.java#L336

It’s why using resolve would be much nicer, but has the limitation of no SRV support. Any thoughts on a cleaner way to avoid duplicating what looks like pretty hairy (i.e. easily buggy) code?

If there doesn’t seem to be a good way, or clean netty integration point, will just copy-paste 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Creating Endpoint Groups - BloxOne Threat Defense
On the Endpoints page, select the Endpoint Groups tab, and then click the Create button. On the Create Endpoint Group page, complete the ......
Read more >
Azure Private Endpoint DNS configuration | Microsoft Learn
The DNS zone group is a strong association between the private DNS zone and the private endpoint that helps auto-updating the private DNS...
Read more >
Adding, editing, or removing a standard endpoint
You can add or remove endpoints from endpoint groups based on usage. For example, if demand on your application increases, you can create...
Read more >
Internet network endpoint groups overview | Load Balancing
An internet network endpoint group (NEG) defines an external backend for a load ... The external HTTP(S) load balancer uses a DNS resolver...
Read more >
Configuring Endpoints for Autodiscovery using DNS - Teradici
Adding the DNS SRV Record¶ · Log in to your Windows Server and select DNS. · Right-click on your DNS server in the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found