-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[WIP] dns: add support for clusters based on SRV DNS record #35160
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Mikhail Galanin <mikhail.galanin@yahoo.com>
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
Signed-off-by: Mikhail Galanin <mikhail.galanin@yahoo.com>
Signed-off-by: Mikhail Galanin <mikhail.galanin@yahoo.com>
Testing locally with Consul:
Add service nodes:
Verify that the service
main doc: https://developer.hashicorp.com/consul/docs/services/discovery/dns-static-lookups |
Hi there, apologies for openning in this state - I acknowledge that there still lots. |
Thanks for you contribution. But based on our contributing rules (see https://github.com/envoyproxy/envoy/blob/main/CONTRIBUTING.md), any extension, should have a maintainer sponsor to help review and maintain the code. And I think this should be a DNS extension rather than a new cluster extension? |
@wbpcode, Thank you for your comment. I posted a message in slack some while ago but didn't hear anything back. What would be the right way for this?
Based on previous discussion, it was decided to go with the cluster extension. Basically, I followed the previous proposal. I will be happy to discuss the new design if someone helps me to find the right place. The initial issue doesn't seem to have activity :/ |
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
This isn't yet forgotten, going to ping maintainers in the maillist |
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
Signed-off-by: Mikhail Galanin <mikhail.galanin@yahoo.com>
I'll sponsor this extension. I'll take a closer look at the PR early next week. |
Hi @ggreenway, Thank you for the response. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A good next step is to write more tests. I'd focus first on an integration test.
} | ||
|
||
message SrvName { | ||
string srv_name = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you anticipate adding additional fields to this message in the future?
@@ -4,6 +4,7 @@ EXTENSION_CONFIG_VISIBILITY = ["//visibility:public"] | |||
EXTENSION_PACKAGE_VISIBILITY = ["//visibility:public"] | |||
EXTENSIONS = { | |||
"envoy.clusters.dynamic_forward_proxy": "//source/extensions/clusters/dynamic_forward_proxy:cluster", | |||
"envoy.clusters.dns_srv": "//source/extensions/clusters/dns_srv:cluster", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@envoyproxy/envoy-mobile-triage is it correct to add this extension here?
|
||
// One SRV-record may return several hostnames | ||
// We will need to resolve all of the hostnames to IPs. Potentially, | ||
// There can be several hostnames for each hostname. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean "there can be several IPs for each hostname"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi glad you initiated this PR! We have been doing a similar customization in X (i.e. add a resolveSrv method in DNS resolver, and a new cluster type that uses the new resolveSrc method) for quite some time.
I am not really an expert in making envoy changes. The code is inherited from my ex-colleague. But I am happy to collaborate if you want.
// in DnsResolverImpl::PendingResolution::onAresGetAddrInfoCallback()). | ||
pending_srv_res->owned_ = true; | ||
return pending_srv_res.release(); | ||
return nullptr; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: return nullptr
can be removed?
if (parse_srv_status == ARES_SUCCESS) { | ||
for (ares_srv_reply* current_reply = srv_reply; current_reply != NULL; | ||
current_reply = current_reply->next) { | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you plan to put anything in the loop block?
Signed-off-by: Mikhail Galanin <mikhail.galanin@yahoo.com>
Signed-off-by: Mikhail Galanin <mikhail.galanin@yahoo.com>
One more attempt to address #125 (resolve cluster IPs via SRV-record)
Yet on early stage. Tested with Consul and the collowing configuration:
Based on discussion and design doc by @kylebevans in #125 (comment)