Comments (3)
Last week I did some testing to confirm that this issue stems from retrieveIfIndexFromMAC
. The cilium-cni plugin binary uses netlink.LinkSetMTU to change interface MTUs. I modified the code for this function to output the following:
- The name of the executable currently running (ie
os.Executable()
). - The attributes of the
Link
object passed toLinkSetMTU
(ielink.Attrs()
). - The current time.
- The MTU passed to
LinkSetMTU
. - The runtime stack (ie debug.Stack()).
I was able to gather data to confirm the cilium-cni is modifying default interface MTUs inside of retrieveIfIndexFromMAC
after receiving a CNI Add request. For example when running with WireGuard on an EKS cluster with ENI IPAM, interfaces on the node such as eth0
and/or eth1
will have their MTU lowered to 8192
. (Note, this is running with a version of Cilium that does not include #33304.) The bug can be triggered by scheduling a bunch of Pods.
Here's roughly what the flow of the relevant code path looks like:
I chatted with @clay-moss who was able to make sense of this. The cilium-cni receives a CNI Add request, then reaches out to the Cilium Agent to request IPAM information. When running in Azure, AWS ENI, or AlibabaCloud IPAM mode, the Cilium Agent may respond with an IP that is associated with one of the default interfaces of a node. This is expected behavior and documented (for example, see here for AWS ENI). When the MAC address of one of the default interfaces on the node is passed to retrieveIfIndexFromMAC
, a call to netlink.LinkSetMTU
is made which changes the MTU of the default interface.
This code path has been in place since fac1802, which was committed back in 2020. My assumption is that we haven't caught this issue because normally the cilium-cni just sets the MTU on a default interface to the MTU value that the Cilium Agent read from the interface during startup. A user may come across this issue if they try to manually change the MTU of a default interface while Cilium is running, as eventually the interface's MTU will be restored.
Out of all the engineers I've discussed this with, the underlying assumption is that Cilium should not change the MTU of existing interfaces, especially those that are not managed by Cilium on a node. My recommendation is for us to remove the MTU management from retrieveIfIndexFromMAC
, which will restore this assumption. Additionally, we should write an integration test which checks to see if this assumption is being held true.
from cilium.
In the previous comment, I mentioned that retrieveIfIndexFromMAC
was added in commit fac1802, but that was incorrect. It was actually added in commit 26308b6, which was part of #11073.
from cilium.
Actually, @joestringer found that the code was added in commit 27ff371, which was part of #8347 that added ENI support to Cilium
from cilium.
Related Issues (20)
- Strange reference to 99.105.108.105/24 HOT 2
- Pods lose IPv6 connectivity at some point of their lifetime if multi-pool is used
- fatal error: concurrent map iteration and map write in github.com/cilium/cilium/pkg/auth HOT 1
- CFP: Support Layer 2 VPN Pods
- testing: Extend kind.sh --secondary-network to use L3 netdev
- CFP: surface ICMP Type=3,Code=4 flows/counters to potentially detect MTU misconfigurations
- CFP: Cilium Gateway API - more Gateway features HOT 1
- CFP: Dynamic Cell Lifecycle HOT 1
- IPsec errors in 1.15.6 HOT 1
- Intermittent endpoint regeneration failure leads to DNS resolution errors in pods
- Kubernetes network policy for api-server
- unable to determine direct routing device. Use --direct-routing-device to specify it (except that option is set) HOT 1
- Cilium 1.15 too many open unix sockets HOT 3
- Failed loading `cil_sock{4,6}_connect` in AKS when running 1.16+ HOT 16
- The real meaning about l34_flow's time and l7_flow's time.
- ExternalTrafficPolicy local support for Ingress services does not handle healtchecks correctly HOT 2
- Dependency Dashboard
- Remove PurgeHook from ctmap after Cell migration
- kpr: detect setups where the SocketLB for pods is non-functional HOT 1
- Cilium does not SNAT external source IP for pods on same node
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cilium.