Skip to content
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

Kube-router should auto-configure sensible MTU for kube-bridge instead of default one #165

Closed
murali-reddy opened this issue Sep 17, 2017 · 9 comments · Fixed by #989
Closed
Assignees

Comments

@murali-reddy
Copy link
Member

murali-reddy commented Sep 17, 2017

CNI bridge plug-in can be configured explictly to set MTU for the bridge and pod interfaces connected to the bridge

https://github.com/containernetworking/plugins/tree/master/plugins/main/bridge

Kube-router does not set MTU value by defaults, so it get sets to default value of 1500.

In cases where physical interface has large MTU (for e.g 9001) then kube-bridge can become bottleneck as path MTU effectively reduces to 1500

@murali-reddy murali-reddy changed the title Kube-router should set sensible MTU for kube-bridge instead of default one Kube-router should auto-configure sensible MTU for kube-bridge instead of default one Sep 18, 2017
@murali-reddy murali-reddy self-assigned this Sep 21, 2017
@dimm0
Copy link
Contributor

dimm0 commented Feb 10, 2018

@murali-reddy any expected date for this? We really need it.

Also I was able to set manually the veth devices MTU, then kube-bridge MTU, then added the proper MTU to /etc/docker/daemon.json, but still having 1500 on my container's eth0

@murali-reddy
Copy link
Member Author

@dimm0 i am not sure how to go about existing clusters, but in new cluster certainly MTU can be set. I will see what other CNI providers that use bridge is inferring a sensible MTU.

@jpds
Copy link
Contributor

jpds commented Feb 13, 2018

In addition to autoconfiguring this, there should be a environment variable or option that sets the MTU for the CNI. With Calico IP-in-IP, they recommend setting this to 8950 on hosts with MTU of 9000.

@murali-reddy murali-reddy added this to To Do in v.0.2.0 via automation Feb 14, 2018
@murali-reddy
Copy link
Member Author

I have marked this issue for next release. Will try to get resolution for this issue.

@jjo
Copy link
Contributor

jjo commented May 23, 2018

For other ones facing this issue, a very nasty dont-show-your-mom-like workaround
I'm using on deployed nodes (via terraform, in my case), as changing /etc/docker/daemon.json
doesn't apply to devices other than docker0 (kube-bridge an others attached to it in this case):

sudo tee /etc/udev/rules.d/71-docker-mtu.rules << EOF
## Force MTU down for devices w/1500 and addr_assign_type != permanent address (pre-set)
## ^ doesn't work as eth0 inside container is not touched :(
# SUBSYSTEM=="net", ACTION=="add", ATTR{mtu}=="1500", ATTR{addr_assign_type}!="0", RUN+="/sbin/ip link set mtu 1450 dev '%k'"
# SUBSYSTEM=="net", ACTION=="add", KERNEL=="kube-bridge", RUN+="/sbin/ip link set mtu 1450 dev '%k'"
## Hack any e(thernet) with mtu!=1500 for MSS clamp
SUBSYSTEM=="net", ACTION=="add", KERNEL=="e*", ATTR{mtu}!="1500", RUN+="/sbin/iptables -I FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS  --clamp-mss-to-pmtu -o %k"
SUBSYSTEM=="net", ACTION=="add", KERNEL=="e*", ATTR{mtu}!="1500", RUN+="/sbin/iptables -I OUTPUT  -p tcp --tcp-flags SYN,RST SYN -j TCPMSS  --clamp-mss-to-pmtu -o %k"
EOF
sudo udevadm control -R
sudo udevadm trigger --attr-match=subsystem=net -c add

@igor-loncarevic
Copy link

igor-loncarevic commented Nov 8, 2018

I have marked this issue for next release. Will try to get resolution for this issue.

Hey --- any news about resolution of putting mtu as variable? Bridge plugin has already interface for it: mtu (integer, optional): explicitly set MTU to the specified value. Defaults to the value chosen by the kernel.

Thanks

@michaelajr
Copy link

Any update?

@murali-reddy
Copy link
Member Author

@carnivorelogic @michaelajr I will work on fix for this. Should be part of next release.

@murali-reddy murali-reddy added this to To Do in 1.0 via automation Feb 15, 2020
@rearden-steel
Copy link

@murali-reddy is there any chance to get this fix implemented?

@murali-reddy murali-reddy removed this from To Do in 1.0 Jun 11, 2020
@murali-reddy murali-reddy added this to To do in 1.1 via automation Jun 11, 2020
murali-reddy added a commit that referenced this issue Sep 15, 2020
murali-reddy added a commit that referenced this issue Sep 29, 2020
1.1 automation moved this from To do to Done Oct 2, 2020
aauren pushed a commit that referenced this issue Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
1.1
  
Done
v.0.2.0
  
To Do
Development

Successfully merging a pull request may close this issue.

7 participants