chaos-controller
chaos-controller copied to clipboard
feat(network-disruption): add DNS resolver control
What does this PR do?
- [x] Adds new functionality
- [ ] Alters existing functionality
- [ ] Fixes a bug
- [ ] Improves documentation or testing
Please briefly describe your changes as well as the motivation behind them:
Changes:
- Adds per-host DNS resolution strategy control through a new
dnsResolverfield on network disruption hosts - Implements four DNS resolver strategies:
pod,node,pod-fallback-node(default), andnode-fallback-pod - Refactors DNS client to support strategy-based resolution with
ResolveWithStrategymethod - Adds
getResolversAndNameshelper method for cleaner DNS configuration logic
Motivation:
- 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
- Provides flexibility for users to choose between pod and node nameservers based on their cluster configuration
- Maintains backward compatibility with default
pod-fallback-nodestrategy
Resolves: #882
Code Quality Checklist
- [x] The documentation is up to date.
- [x] My code is sufficiently commented and passes continuous integration checks.
- [x] I have signed my commit (see Contributing Docs).
Testing
- [x] I leveraged continuous integration testing
- [x] by depending on existing
unittests orend-to-endtests. - [x] by adding new
unittests orend-to-endtests.
- [x] by depending on existing
- [x] I manually tested the following steps:
- Test default behavior without specifying
dnsResolverfield (uses pod-fallback-node) - Test
dnsResolver: podstrategy to verify pod-only DNS resolution - Test
dnsResolver: nodestrategy to verify node-only DNS resolution - Test
dnsResolver: pod-fallback-nodewith pod DNS failure to verify fallback - Test
dnsResolver: node-fallback-podwith node DNS failure to verify fallback - Test with Istio-enabled namespace using
dnsResolver: nodeto bypass DNS proxy - [x] locally.
- [ ] as a canary deployment to a cluster.
- Test default behavior without specifying
-
#1012
-
#1011
-
#1010
-
#1009
👈 (View in Graphite)
-
main
This stack of pull requests is managed by Graphite. Learn more about stacking.
✅ Tests
🎉 All green!
❄️ No new flaky tests detected
🧪 All tests passed
🔗 Commit SHA: a81a3d8 | Docs | Datadog PR Page | Was this helpful? Give us feedback!