Allow Pods Network to have smaller MTU than Nodes

We should allow Pods Network MTU to be smaller than the
MTU of the Host VM to address scenarios like Nodes Network
being a provider network, while Pods Network is a Tenant
Network. This commit fixes the issue by allowing binding
of VIFs with MTU smaller than the Nodes.

Change-Id: Ibadcd07824702ff1160a4a1d6d10313c15910dea
This commit is contained in:
Maysa Macedo 2021-03-30 17:06:21 +00:00
parent 0ece1e0c6a
commit 07a3723f20
1 changed files with 4 additions and 4 deletions

View File

@ -109,15 +109,15 @@ class NestedDriver(health.HealthHandler, b_base.BaseBindingDriver,
# driver for getting the link device. # driver for getting the link device.
vm_iface_name = self._detect_iface_name(h_ipdb) vm_iface_name = self._detect_iface_name(h_ipdb)
mtu = h_ipdb.interfaces[vm_iface_name].mtu mtu = h_ipdb.interfaces[vm_iface_name].mtu
if mtu != vif.network.mtu: if mtu < vif.network.mtu:
# NOTE(dulek): This might happen if Neutron and DHCP agent # NOTE(dulek): This might happen if Neutron and DHCP agent
# have different MTU settings. See # have different MTU settings. See
# https://bugs.launchpad.net/kuryr-kubernetes/+bug/1863212 # https://bugs.launchpad.net/kuryr-kubernetes/+bug/1863212
raise exceptions.CNIBindingFailure( raise exceptions.CNIBindingFailure(
f'MTU of interface {vm_iface_name} ({mtu}) does not ' f'MTU of interface {vm_iface_name} ({mtu}) is smaller '
f'match MTU of pod network {vif.network.id} ' f'than MTU of pod network {vif.network.id} '
f'({vif.network.mtu}). Please make sure pod network ' f'({vif.network.mtu}). Please make sure pod network '
f'has the same MTU as node (VM) network.') f'has the same or smaller MTU as node (VM) network.')
args = self._get_iface_create_args(vif) args = self._get_iface_create_args(vif)
with h_ipdb.create(ifname=temp_name, with h_ipdb.create(ifname=temp_name,