Add MTU on bonded and phy interface vlans
Adds MTU on bonded vlans and phy interface vlans, with the value set to .capm3.network_interfaces.mtu, instead of default 1500.
Does so based on Metal3DataTemplate.spec.networkData.links.vlans.mtu, available for driving the MTU of a VLAN interface in CAPM3:
$ kubectl explain Metal3DataTemplate.spec.networkData.links.vlans.mtu
GROUP: infrastructure.cluster.x-k8s.io
KIND: Metal3DataTemplate
VERSION: v1beta1
FIELD: mtu <integer>
DESCRIPTION:
MTU is the MTU of the interface
$
Closes #124 (closed)
It was tested in capm3-ha-kubeadm-virt-ubuntu for an adjacent MR sylva-projects/sylva-core!2153 (merged), where we can see 'mtu': 1450 bring set in cloud-init:
# workload-cluster-dump\node_logs\wc-1398275244-kubeadm-capm3-virt-control-plane-5vr52.tar\wc-1398275244-kubeadm-capm3-virt-control-plane-5vr52\log\cloud-init.log
2024-08-02 10:35:09,652 - networking.py[DEBUG]: net: all expected physical devices present
2024-08-02 10:35:09,652 - stages.py[DEBUG]: applying net config names for {'version': 1, 'config': [{'mtu': 1450, 'type': 'bond', 'subnets': [{'netmask': '255.255.255.0', 'routes': [], 'type': 'static', 'address': '192.168.10.63', 'ipv4': True}], 'params': {'mac_address': '52:54:00:44:44:06', 'bond_miimon': 100, 'bond_mode': '802.3ad', 'bond_xmit_hash_policy': 'layer3+4'}, 'name': 'bond0', 'bond_interfaces': ['ens4', 'ens5']}, {'mtu': 1450, 'type': 'physical', 'subnets': [], 'mac_address': '52:54:00:44:44:06', 'name': 'ens4'}, {'mtu': 1450, 'type': 'physical', 'subnets': [], 'mac_address': '52:54:00:55:55:06', 'name': 'ens5'}, {'mtu': 1450, 'type': 'vlan', 'subnets': [{'netmask': '255.255.255.0', 'routes': [{'gateway': '192.168.100.1', 'netmask': '0.0.0.0', 'network': '0.0.0.0', 'services': []}], 'type': 'static', 'address': '192.168.100.63', 'ipv4': True}], 'name': 'bond0.100', 'vlan_id': 100, 'mac_address': '52:54:00:44:44:06', 'vlan_link': 'bond0'}, {'address': '1.1.1.1', 'type': 'nameserver'}]}
This was an adjacent MR, because it turned out Ubuntu's netplan didn't like the fact that bond0.100 vlan interface MTU (has a default value of 1500, per #124 (closed)) was higher than bond0's MTU (having a value of max 1450, since sylva-projects/sylva-core!2349 (merged)). And this was in turn blocking development for Ubuntu CIs of sylva-projects/sylva-core#989 (closed) for the last month or so.