fix(kubernetes): set explicit MTU for Cilium in tenant clusters#2147
fix(kubernetes): set explicit MTU for Cilium in tenant clusters#2147kvaps merged 1 commit intocozystack:mainfrom
Conversation
Cilium's MTU auto-detection does not account for VXLAN overhead when running inside KubeVirt VMs. The VM interface inherits MTU 1400 from the parent OVN/Geneve overlay, and Cilium sets all interfaces (cilium_vxlan, lxc*, cilium_host/net) to 1400 without subtracting the 50-byte VXLAN encapsulation overhead. This causes intermittent packet drops for large packets (TLS handshakes, HTTP responses with data), resulting in timeouts and 499 errors for services running in tenant clusters. Set MTU to 1350 (1400 - 50 VXLAN overhead) explicitly in the default Cilium values for tenant Kubernetes clusters. Signed-off-by: IvanHunters <[email protected]>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA single configuration parameter was added to the Cilium HelmRelease template, specifying an MTU value of 1350 in the cilium values block. This minimal change affects the network settings applied during HelmRelease rendering. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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, 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 resolves critical connectivity issues within tenant Kubernetes clusters by adjusting the Maximum Transmission Unit (MTU) for Cilium. By setting a specific MTU value, it prevents silent packet drops that occurred due to the overhead introduced by VXLAN encapsulation, thereby improving network stability and reliability for services running in these environments. 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 correctly addresses packet drops in KubeVirt-based tenant clusters by setting an explicit MTU of 1350 for Cilium. This change accounts for the VXLAN encapsulation overhead missed by auto-detection, resolving the described connectivity issues. I've added a suggestion to include a comment documenting the reason for this specific MTU value to improve long-term maintainability.
| k8sServiceHost: {{ .Release.Name }}.{{ .Release.Namespace }}.svc | ||
| k8sServicePort: 6443 | ||
| routingMode: tunnel | ||
| MTU: 1350 |
There was a problem hiding this comment.
While the value 1350 is correct according to the pull request description, it appears as a 'magic number' in the code. For better long-term maintainability, it's good practice to add a comment explaining how this value is derived (i.e., 1400 MTU from the host - 50 bytes for VXLAN overhead).
# Set MTU to 1350 to account for VXLAN overhead (50 bytes) in KubeVirt VMs,
# which inherit a 1400 MTU from the host cluster's overlay network.
MTU: 1350
Summary
Problem
Cilium's MTU auto-detection does not account for VXLAN overhead when running inside KubeVirt VMs. The VM network interface inherits MTU 1400 from the parent cluster's OVN/Geneve overlay (1500 - 100 Geneve overhead). Cilium detects this MTU and applies it to all tunnel interfaces without subtracting the 50-byte VXLAN encapsulation overhead.
This results in:
Fix
Explicitly set
MTU: 1350(1400 - 50 VXLAN overhead) in the default Cilium values for tenant clusters. This value can still be overridden viaaddons.cilium.valuesOverrideif needed.Test plan
Summary by CodeRabbit