envoyproxy / envoy

Cloud-native high-performance edge/middle/service proxy
https://www.envoyproxy.io
Apache License 2.0
25.06k stars 4.82k forks source link

dynamic_forward_proxy: Support SRV query lookup in DNS cache used by the custom cluster. #16374

Open ntgsx92 opened 3 years ago

ntgsx92 commented 3 years ago

Title: Support SRV query lookup in DNS cache used by the custom cluster in DFP filter.

Description:

This feature request is most likely a subset of existing issue for supporting SRV query in Envoy in general. However, it doesn't seem like there's much discussion around supporting it in Dynamic Forward Proxy filter based on the previous discussion. DNS cache used by Dynamic Forward Proxy filter currently performs A record lookup and works similarly to a cluster using Logical DNS for service discovery.

[optional Relevant Links:]

Any extra documentation required to understand the issue.

Sooryaa-A commented 3 years ago

we too have a use case with DNS srv query support for dynamic fwd proxy filter.

Have observed that even if url is having http , if port is not mentioned in URL, envoy is using default secure port "443" instead fo default http port 80

image

using envoy 1.16.1

antoniovicente commented 3 years ago

cc @mattklein123 @alyssawilk

An option to use DNS SRV when doing dynamic forward proxy seems useful. We may also want an option to fallback to regular DNS records if the SRV lookup fails.

alyssawilk commented 3 years ago

That'd be fantastic. I don't think we have anyone who can work on it immediately, but I suspect it'll happen by end of year. cc @DavidSchinazi who may have thoughts on timline, especially w.r.t QUIC

DavidSchinazi commented 3 years ago

@alyssawilk this issue is about SRV records which only allow you to convey the port number for HTTP or HTTPS. It's a neat feature but not high priority in my mind. The new record that I've been eyeing is the HTTPS record which also conveys HTTP/3 support and TLS client hello encryption keys. But that's not what this issue is about.

Shikugawa commented 3 years ago

@mattklein123 I can take this task if no one working on this.

mattklein123 commented 3 years ago

@mattklein123 I can take this task if no one working on this.

Sure go for it, though I would recommending finishing SRV support in general first. I would love to see that land.

Shikugawa commented 3 years ago

Finally DNS resolution as extension was merged. We can start to work on SRV record support on c-ares extension.

ntgsx92 commented 2 years ago

@Shikugawa I see the https://github.com/envoyproxy/envoy/pull/19091 has became stale/closed. Is this something that you're still interested in doing? We have been using c-ares with SRV resolution in our forked envoy and would love upstream the change to the DNS extension if possible. I can pick up the pr if that's okay. Thanks!

trvll commented 1 year ago

Any update on that? This feature would be handful on my current project. I would be more than happy to collaborate on that since I have been customizing dynamic forward proxy and DNS cache for different purposes.

alyssawilk commented 1 year ago

alas no, but I'd be very happy to have support for it. I had a partial PR for adding a resolver using res_query, but while I got it to the point it passed manual testing I wasn't confident of parsing the corner cases correctly so never sent it out.