-
Notifications
You must be signed in to change notification settings - Fork 37
[CHAOSPLT-1359] Add DNS resolver control #1009
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
base: main
Are you sure you want to change the base?
Conversation
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🔗 Commit SHA: 7b43367 | Docs | Datadog PR Page | Was this helpful? Give us feedback! |
faf7d30 to
91df8fa
Compare
| for _, host := range s.Hosts { | ||
| args = append(args, "--hosts", fmt.Sprintf("%s;%d;%s;%s;%s", host.Host, host.Port, host.Protocol, host.Flow, host.ConnState)) | ||
| if host.DNSResolver == "" { | ||
| args = append(args, "--hosts", fmt.Sprintf("%s;%d;%s;%s;%s", host.Host, host.Port, host.Protocol, host.Flow, host.ConnState)) |
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.
why not just having host.DNSResolver set to "" even if it's empty? Seems like we also add empty "" if nothing is defined in other fields. I don't think we need any ifs?
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.
Another way we could have is to have the default be set before? That way it's never empty? (although I can't remember if it's something we do in the chaos-controller or not, so ignore it if we do not do this usually)
|
|
||
| When Istio DNS proxy is enabled, pod-level DNS lookups may return VIP addresses (Class E subnet: 240.0.0.0/4) that don't work for network disruptions. In this case, use `dnsResolver: node` to bypass the Istio proxy and get the actual service IPs: | ||
|
|
||
| ```yaml |
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.
could we have those examples be defined in the examples/ dir and link them instead?
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.
I don't really see the added value because the examples are more here to test the disruption effect. Here the resolution of the host will be the same if it's resolved by the node or the pod resolver.
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.
as you want, but we still need to update the complete example to add your new field
Adds per-host DNS resolution strategy control to allow users to specify whether hostnames should be resolved using pod or node nameservers. This addresses issues with service mesh proxies (like Istio DNS proxy) that intercept DNS queries and return VIP addresses (240.x.x.x) that don't work with tc traffic control rules. Users can now specify dnsResolver field on each host with strategies: "pod", "node", "pod-fallback-node" (default), or "node-fallback-pod". The default behavior maintains backward compatibility by trying pod DNS first with automatic fallback to node DNS. Resolves: #882 Jira: CHAOSPLT-1359
91df8fa to
7b43367
Compare
|
|
||
| ### Case 5: Controlling DNS Resolution with `dnsResolver` | ||
|
|
||
| When specifying hostnames in the `hosts` or `allowedHosts` fields, you can control which DNS resolver is used to resolve the hostname to an IP address. This is particularly useful in environments with service mesh proxies (like Istio) that intercept DNS queries and return virtual IPs (VIPs) that may not work for traffic disruption. |
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.
To make it a little more clear?
| When specifying hostnames in the `hosts` or `allowedHosts` fields, you can control which DNS resolver is used to resolve the hostname to an IP address. This is particularly useful in environments with service mesh proxies (like Istio) that intercept DNS queries and return virtual IPs (VIPs) that may not work for traffic disruption. | |
| When specifying hostnames in the `hosts` or `allowedHosts` fields, you can control which DNS resolver is used to resolve the hostname to an IP address. This is particularly useful in environments with service mesh proxies (like Istio) that intercept DNS queries and return virtual IPs (VIPs) that may not work for traffic disruption. In these cases, you should rely on the node-level resolver to ensure the hostnames resolve to the actual destination IPs rather than the service mesh VIP. |

What does this PR do?
Please briefly describe your changes as well as the motivation behind them:
Changes:
dnsResolverfield on network disruption hostspod,node,pod-fallback-node(default), andnode-fallback-podResolveWithStrategymethodgetResolversAndNameshelper method for cleaner DNS configuration logicMotivation:
pod-fallback-nodestrategyResolves: #882
Code Quality Checklist
Testing
unittests orend-to-endtests.unittests orend-to-endtests.dnsResolverfield (uses pod-fallback-node)dnsResolver: podstrategy to verify pod-only DNS resolutiondnsResolver: nodestrategy to verify node-only DNS resolutiondnsResolver: pod-fallback-nodewith pod DNS failure to verify fallbackdnsResolver: node-fallback-podwith node DNS failure to verify fallbackdnsResolver: nodeto bypass DNS proxy