diff --git a/microk8s-resources/wrappers/run-kubelite-with-args b/microk8s-resources/wrappers/run-kubelite-with-args index 08a5ee472e..167bc8e62e 100755 --- a/microk8s-resources/wrappers/run-kubelite-with-args +++ b/microk8s-resources/wrappers/run-kubelite-with-args @@ -212,6 +212,19 @@ then fi fi +# kube-proxy reads some values related to the 'nf_conntrack' kernel +# module from procfs on startup, so we must ensure it is loaded: +if ! [ -f /proc/sys/net/netfilter/nf_conntrack_max ] +then + if /sbin/modprobe nf_conntrack || modprobe nf_conntrack + then + echo "Successfully loaded nf_conntrack module." + else + echo -n "Failed to load nf_conntrack kernel module. " + echo "ProxyServer will fail to start until it's loaded." + fi +fi + # on lxc containers do not try to change the conntrack configuration # see https://github.com/canonical/microk8s/issues/1438 if grep -E lxc /proc/1/environ &&