Skip to content

Commit

Permalink
Fix pods unable to send traffic to ClusterIP
Browse files Browse the repository at this point in the history
Flannel with VXLAN suffers from a bug[1] where pods on the same node are
unable to send traffic to a service's ClusterIP when the endpoint is on
the same node.

This is due to improper NATTing of the return traffic.

The fix is to load the br_netfilter module as specified in the
kubernetes doc.[2]

[1] flannel-io/flannel#1702
[2] https://kubernetes.io/docs/setup/production-environment/container-runtimes/#forwarding-ipv4-and-letting-iptables-see-bridged-traffic

Change-Id: Ic182bba9d480421c2cb581558ebde8dfb20421c8
  • Loading branch information
waipeng committed Mar 29, 2023
1 parent b7092d3 commit ae7a50e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ EOF
systemctl restart NetworkManager
fi
elif [ "$NETWORK_DRIVER" = "flannel" ]; then
$ssh_cmd modprobe vxlan
echo "vxlan" > /etc/modules-load.d/vxlan.conf
$ssh_cmd modprobe -a vxlan br_netfilter
cat <<EOF > /etc/modules-load.d/flannel.conf
vxlan
br_netfilter
EOF
fi


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@ EOF
$ssh_cmd systemctl restart NetworkManager
fi
elif [ "$NETWORK_DRIVER" = "flannel" ]; then
$ssh_cmd modprobe vxlan
echo "vxlan" > /etc/modules-load.d/vxlan.conf
$ssh_cmd modprobe -a vxlan br_netfilter
cat <<EOF > /etc/modules-load.d/flannel.conf
vxlan
br_netfilter
EOF

fi

mkdir -p /srv/magnum/kubernetes/
Expand Down

0 comments on commit ae7a50e

Please sign in to comment.