-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
feat: support configuring the order of the upstream dns service discovery resolve #7935
feat: support configuring the order of the upstream dns service discovery resolve #7935
Conversation
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.
@monkeyDluffy6017 We should also update the https://apisix.apache.org/docs/apisix/discovery/dns/#service-discovery-via-dns.
apisix/discovery/dns/schema.lua
Outdated
uniqueItems = true, | ||
items = { | ||
enum = {"last", "SRV", "A", "AAAA", "CNAME"}, | ||
-- ["not"] = { |
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.
Just for debug?
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.
Done
t/discovery/dns/sanity.t
Outdated
servers: | ||
- "127.0.0.1:1053" | ||
order: | ||
- A |
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.
Is it possible to add some test about invalid input, like a
or repeated record type?
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.
Done
id: 1 | ||
--- must_die | ||
--- error_log | ||
matches none of the enum values |
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.
Can we add a test case: DNS Server returns SRV records first for the same domain name, and the next query returns A records?
Done |
…very resolve
Description
Some users are having problems with the upstream DNS service discovery feature, because the current DNS resolution order is fixed: 1. "last" 2. "SRV" 3. "A" 4. "AAAA" 5. "CNAME".
"last" means the last successful resolving method; that is, if the last resolving is successful, the last resolving method will be used first.
This causes the problem that if for some reason the A record is resolved successfully, the higher priority SRV record will not be resolved in the future, and the user expects to get the result of resolving the SRV record.
As a user, I want to configure how and in what order the upstream DNS service discovery function resolves, and APISIX is able to resolve in the way and in the order I configure.
Checklist