fix(routes): add IPIP return path on leader when local=false#7
Conversation
When running with --local=false and --compatibility=cilium, the leader node did not create IPIP return routes for non-leader nodes in the same location. This caused asymmetric routing: non-leaders encapsulated traffic to the leader via IPIP (through Cilium's VxLAN overlay), but the leader sent replies directly via the physical interface, which could be dropped by cloud networks blocking IP protocol 4 or by reverse path filtering on the non-leaders. Add a new routing block for the !local case that creates: - Routes in table 1107 using the overlay gateway (Cilium internal IP) so IPIP outer packets traverse the VxLAN tunnel - Policy rules matching traffic arriving on the WireGuard interface (iif kilo0) destined for non-leader private IPs This only activates when the encapsulator returns a gateway different from the node's private IP, i.e. when an overlay like Cilium is in use. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThis change adds a new routing block in pkg/mesh/routes.go that generates additional routes for non-local scenarios, directing traffic destined to other nodes' private IPs through an overlay gateway via the tunnel interface when encapsulation is enabled. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello @kvaps, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical routing problem in environments using kilo with "--local=false" and Cilium compatibility. Previously, leader nodes would not correctly route IPIP return traffic to non-leader nodes, causing network communication failures. The changes introduce specific routing rules on the leader to ensure that IPIP encapsulated traffic is properly sent back through the overlay network, thereby restoring full connectivity and preventing packet drops. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a fix for a routing issue where IPIP return paths were missing on leader nodes when local=false, particularly in environments using Cilium. The change correctly adds routes and rules to ensure return traffic is properly encapsulated and routed through the overlay network. The approach is sound, and I have one suggestion to ensure the source IP of the new route is explicitly set for correctness and consistency.
Summary
--local=falseand--compatibility=cilium, the leader did not create IPIP return routes for non-leader nodes in the same locationiif kilo0 → table 1107) on the leader that use the overlay gateway (Cilium internal IP) so IPIP outer packets traverse the VxLAN tunnel back to non-leadersTest plan
--local=false --encapsulate=crosssubnet --compatibility=cilium10.2.1.x via <cilium_ip> dev tunl0 table 1107 onlinkiif kilo0policy rules are created for non-leader private IPskubectl execon worker nodes works (was timing out before)Summary by CodeRabbit