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

update flannel v0.24.2 #5071

Merged
merged 5 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions addons/flannel/0.24.2/flannel-ethtool.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=Disable vxlan checksum offloading for flannel.1
After=sys-devices-virtual-net-flannel.1.device
Requires=sys-devices-virtual-net-flannel.1.device

[Service]
Type=oneshot
ExecStart=/sbin/ethtool -K flannel.1 tx-checksum-ip-generic off
RemainAfterExit=yes

[Install]
WantedBy=sys-devices-virtual-net-flannel.1.device
33 changes: 33 additions & 0 deletions addons/flannel/0.24.2/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,43 @@ function flannel() {
kubectl rollout restart --namespace=kube-flannel daemonset/kube-flannel-ds
fi

if flannel_detect_vmware_nic; then
flannel_install_ethtool_service "$src"
fi

flannel_ready_spinner
check_network
}

function flannel_detect_vmware_nic() {
if lspci -v | grep Ethernet | grep -q "VMware VMXNET3"; then
return 0
fi
return 1
}


function flannel_install_ethtool_service() {
# this disables the tcp checksum offloading on flannel interface - this is a workaround for
# certain VMWare NICs that use NSX and have a conflict with the way the checksum is handled by
# the kernel.
local src="$1"

logStep "Installing flannel ethtool service"
logStep "Disabling TCP checksum offloading on flannel interface for VMWare VMXNET3 NICs"

cp "$src/flannel-ethtool.service" /etc/systemd/system/flannel-ethtool.service

systemctl daemon-reload
systemctl enable flannel-ethtool.service
if ! timeout 30s systemctl start flannel-ethtool.service; then
log "Failed to start flannel-ethtool.service within 30s, restarting it"
systemctl restart flannel-ethtool.service
fi

logSuccess "Flannel ethtool service installed"
}

function flannel_init_pod_subnet() {
POD_CIDR="$FLANNEL_POD_CIDR"
POD_CIDR_RANGE="$FLANNEL_POD_CIDR_RANGE"
Expand Down
9 changes: 3 additions & 6 deletions addons/flannel/template/base/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,23 +160,20 @@ function flannel() {
}

function flannel_detect_vmware_nic() {
local vmxnet3=false

if lspci -v | grep Ethernet | grep -q "VMware VMXNET3"; then
vmxnet3=true
return 0
fi

return $vmxnet3
return 1
}


function flannel_install_ethtool_service() {
# this disables the tcp checksum offloading on flannel interface - this is a workaround for
# certain VMWare NICs that use NSX and have a conflict with the way the checksum is handled by
# the kernel.
local src="$1"

logStep "Installing flannel ethtool service"
logStep "Disabling TCP checksum offloading on flannel interface for VMWare VMXNET3 NICs"

cp "$src/flannel-ethtool.service" /etc/systemd/system/flannel-ethtool.service

Expand Down
Loading