-
Notifications
You must be signed in to change notification settings - Fork 254
feat: snat azure dns traffic to node ip and remove jump to swift postrouting in iptables legacy #3930
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: master
Are you sure you want to change the base?
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.
Pull Request Overview
This PR modifies SNAT behavior for Azure DNS traffic in Linux podsubnet scenarios by changing the source IP from the primary subnet IP to the node IP, and removes conflicting iptables-legacy rules to prevent conflicts with iptables-nftables.
- Changes SNAT target from subnet primary IP to node IP for Azure DNS traffic
- Removes jump to SWIFT-POSTROUTING in iptables-legacy to avoid rule conflicts
- Adds support for iptables-legacy client interface to handle cleanup operations
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
cns/restserver/restserver.go | Adds iptablesLegacyClient interface and getter method |
cns/restserver/internalapi_windows.go | Implements unsupported legacy iptables for Windows |
cns/restserver/internalapi_linux_test.go | Updates tests to verify node IP usage and legacy rule deletion |
cns/restserver/internalapi_linux.go | Implements legacy iptables deletion and changes SNAT target to node IP |
cns/fakes/iptablesfake.go | Adds mock implementation for legacy iptables testing |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
…to node ip todo: snat windows podsubnet azure scenario to node ip vnetscale scenarios (cilium and azure) already snat to node ip roll out after cns iptables reconciliation goes in cni still writes snat to primary ip but it is superseded by cns' rules
9578ca5
to
8524b50
Compare
6adfe24
to
b1a7451
Compare
b1a7451
to
b8e0df6
Compare
/azp run Azure Container Networking PR |
Azure Pipelines successfully started running 1 pipeline(s). |
Reason for Change:
Changes the ip CNS-added IPTables rules SNAT to from the primary ip to node ip for linux podsubnet scenarios (both azure and cilium cases). CNI-added iptables rules are not modified and windows behavior remains the same (will be modified in a future PR).
Removes the jump to SWIFT-POSTROUTING in iptables-legacy if it is present as CNS is now built with iptables nftables (so we avoid having iptables-legacy and iptables-nftables conflicting with each other). If both rules exist the order of evaluation is nondeterministic.
This change will likely roll out with the change that enables CNS to programSNAT rules in azure cases (previously CNS would only program iptables rules in cilium cases)
Issue Fixed:
Requirements:
Notes:
Tested upgrade and downgrade gets back to original state (minus the jump to SWIFT-POSTROUTING in iptables-legacy):
cilium podsubnet case (this case potentially has the jump to SWIFT-POSTROUTING in iptables-legacy as older cns versions programmed iptables-legacy rules)
azure podsubnet case (this scenario should only be using iptables-nftables)
Old SWIFT-POSTROUTING rule is successfully deleted in iptables legacy if it exists