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
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