From 2acf662df6b8bbea7f44bf6875180cd535c23b6a Mon Sep 17 00:00:00 2001 From: Mark Beierl Date: Fri, 11 Aug 2023 19:37:02 +0000 Subject: [PATCH] Fixes bug 2285: MTU Issue There is a bug in microk8s 1.26.7 where calico will not be created with the correct MTU: https://github.com/canonical/microk8s/issues/4142 This patch adds a workaround. Change-Id: I164e612c03a70e9417b6f736b71f71b8050fddbc Signed-off-by: Mark Beierl --- installers/charmed_install.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/installers/charmed_install.sh b/installers/charmed_install.sh index 975cbbdc..2ddc797c 100755 --- a/installers/charmed_install.sh +++ b/installers/charmed_install.sh @@ -76,6 +76,11 @@ function install_snaps(){ sudo snap install microk8s --classic --channel=${MICROK8S_VERSION}/stable || FATAL_TRACK k8scluster "snap install microk8s ${MICROK8S_VERSION}/stable failed" sudo usermod -a -G microk8s `whoami` + # Workaround bug in calico MTU detection + if [ ${DEFAULT_IF_MTU} -ne 1500 ] ; then + sudo mkdir -p /var/lib/calico + sudo ln -sf /var/snap/microk8s/current/var/lib/calico/mtu /var/lib/calico/mtu + fi sudo cat /var/snap/microk8s/current/args/kube-apiserver | grep advertise-address || ( echo "--advertise-address $DEFAULT_IP" | sudo tee -a /var/snap/microk8s/current/args/kube-apiserver sg ${KUBEGRP} -c microk8s.stop @@ -582,6 +587,7 @@ function install_microstack() { DEFAULT_IF=`ip route list match 0.0.0.0 | awk '{print $5; exit}'` DEFAULT_IP=`ip -o -4 a |grep ${DEFAULT_IF}|awk '{split($4,a,"/"); print a[1]; exit}'` +DEFAULT_IF_MTU=`ip a show ${DEFAULT_IF} | grep mtu | awk '{print $5}'` check_arguments $@ mkdir -p ~/.osm -- 2.25.1