How to deploy Charmed Kubeflow on MicroK8s behind a web proxy

Key Value
Summary Learn how to deploy Charmed Kubeflow from behind a web proxy
Categories kubeflow
Difficulty 2
Author Rob Gibbon



Duration: 0:30

In this short how-to guide, you will learn how to deploy Charmed Kubeflow on MicroK8s from behind a web proxy.

Configure the systems for operation behind a web proxy

Duration: 10:00

Since MicroK8s includes a few utilities (eg, curl, helm) it makes sense to configure the system proxy settings in /etc/environment. We’ll need to add a few addresses to the proxy exclusion list so that things work as they should.

PROXY_HOST=squid.internal #change as required
PROXY_PORT=3128 #change as required
JUJU_CONTROLLER_NAME=uk8s #change as required

echo "HTTPS_PROXY=http://$PROXY_HOST:$PROXY_PORT" | sudo tee -a /etc/environment
echo "HTTP_PROXY=http://$PROXY_HOST:$PROXY_PORT" | sudo tee -a /etc/environment
echo "NO_PROXY=,,,$CLUSTER_SUBNET,$CLUSTER_HOSTS,admission-webhook.kubeflow.svc,modeloperator.kubeflow.svc,modeloperator.controller-$JUJU_CONTROLLER_NAME.svc,spark.kubeflow.svc,katib-controller.kubeflow.svc," | sudo tee -a /etc/environment
echo "https_proxy=http://$PROXY_HOST:$PROXY_PORT" | sudo tee -a /etc/environment
echo "http_proxy=http://$PROXY_HOST:$PROXY_PORT" | sudo tee -a /etc/environment
echo "no_proxy=,,,$CLUSTER_SUBNET,$CLUSTER_HOSTS,admission-webhook.kubeflow.svc,modeloperator.kubeflow.svc,modeloperator.controller-$JUJU_CONTROLLER_NAME.svc,spark.kubeflow.svc,katib-controller.kubeflow.svc," | sudo tee -a /etc/environment

Reboot the machines and wait until they’re up again.

sudo reboot

Configure required domains

Duration: 10:00

You may need to add the following domains to your firewall’s allow-list:

Once done, you can proceed with the installation.

Install MicroK8s

Duration: 10:00

Kubernetes 1.21: Remember to install the supported MicroK8s version 1.21/stable for Charmed Kubeflow.

sudo snap install microk8s --channel=1.21/stable --classic

Enable MicroK8s storage and wait for it to be available.

microk8s enable storage

Set a local DNS server for CoreDNS

When running behind a proxy, CoreDNS may not be able to reach public DNS servers, so you may want to configure MicroK8s to use a local DNS server. You can configure the DNS server that MicroK8s uses to use the host’s DNS server configuration as follows:
microk8s enable dns:$(resolvectl status | grep "Current DNS Server" | awk '{print $NF}')"

Deploy and bootstrap Juju

Duration: 5:00

Once you’ve deployed MicroK8s as above, the next steps are to install and bootstrap Juju.

PROXY_HOST="squid.internal" #change as required
PROXY_PORT=3128 #change as required

sudo snap install juju --classic
sudo snap install juju-bundle --classic
sudo snap install juju-wait --classic

juju bootstrap microk8s uk8s
juju add-model kubeflow
juju model-config \
  {juju,apt,snap}-http{,s}-proxy=http://$PROXY_HOST:$PROXY_PORT \
  apt-no-proxy=localhost, \

Deploy Kubeflow

Duration: 30:00

When all of the previous steps are completed, you can deploy Kubeflow as usual by following the quickstart guide.

Have questions? Contact our sales team now.

Last updated 2 months ago.