Installing behind a proxy

To let MicroK8s use a proxy we need to enter the proxy details in
${SNAP_DATA}/args/containerd-env (normally /var/snap/microk8s/current/args/containerd-env). The containerd-env file holds the environment variables containerd runs with. Setting the HTTPS_PROXY to your proxy endpoint enables containerd to fetch conatiner images from the web. You may also want to set the NO_PROXY to the cluster-cidr and the services-cidr as specified in the respective configuration files /var/snap/microk8s/current/args/kube-proxy and /var/snap/microk8s/current/args/kube-apiserver.

Here is an example where HTTPS_PROXY is set to https://squid.internal:3128 and NO_PROXY to 10.1.0.0/16,10.152.183.0/24:

HTTPS_PROXY=https://squid.internal:3128
NO_PROXY=10.1.0.0/16,10.152.183.0/24
#
# Some additional environment variables
#
ulimit -n 65536 || true
ulimit -l 16384 || true

For the changes to take effect we need to restart MicroK8s:

microk8s stop
microk8s start