This document will outline steps that will get your local installation of Kubeflow running on top of Mikikube. Minikube runs a simple, single-node Kubernetes cluster inside a virtual machine (VM).
By the end of this document, you’ll have a local installation of Minikube kubernetes clsuter along with all the default core components of Kubeflow deployed as services in the pods. You should be able to access JupyterHub notebooks, and the Kubeflow Dashboard.
If you do not already have a hypervisor installed, install a new one.
Install Virtual Box or VMware Fusion.
Install Virtual Box or KVM.
For installing KVM:
$ sudo apt-get install libvirt-bin kvm virt-manager virt-viewer python-spice-client-gtk qemu-kvm qemu-system
$ sudo usermod -aG libvirtd $USER
Install Virtual Box or KVM.
For installing KVM:
$ sudo yum install qemu-kvm qemu-img virt-manager libvirt libvirt-python libvirt-client virt-install virt-viewer bridge-utils
$ sudo systemctl start libvirtd
$ sudo systemctl enable libvirtd
$ gcloud components install kubectl
$ brew install kubectl
$ sudo apt-get update && sudo apt-get install -y apt-transport-https
$ curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
$ sudo touch /etc/apt/sources.list.d/kubernetes.list
$ echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list
$ sudo apt-get update
$ sudo apt-get install -y kubectl
$ cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
EOF
$ sudo yum install -y kubectl
Please see detailed instructions for Minikube installation. For quick setup instructions follow along below.
$ brew cask install minikube
OR
$ curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.28.0/minikube-darwin-amd64
$ chmod +x minikube
$ sudo mv minikube /usr/local/bin/
$ curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.28.0/minikube-linux-amd64
$ chmod +x minikube
$ sudo mv minikube /usr/local/bin/
$ minikube start --cpus 4 --memory 8096 --disk-size=40g
Notes:
In case, you have the default minikube VM already created (following detailed installation instructions), please use the following to update the VM.
$ minikube stop
$ minikube delete
$ minikube start --cpus 4 --memory 8096 --disk-size=40g
The following steps will deploy Kubeflow components and start them on the Minikube you created above.
Download bootstrapper configuration file.
$ curl -O https://raw.githubusercontent.com/kubeflow/kubeflow/v0.2-branch/bootstrap/bootstrapper.yaml
Apply the config.
$ kubectl create -f bootstrapper.yaml
This should output
namespace "kubeflow-admin" created
clusterrolebinding.rbac.authorization.k8s.io "kubeflow-cluster-admin" created
persistentvolumeclaim "kubeflow-ksonnet-pvc" created
statefulset.apps "kubeflow-bootstrapper" created
Verify the setup worked.
$ kubectl get ns
NAME STATUS AGE
default Active 1m
kube-public Active 1m
kube-system Active 1m
kubeflow-admin Active 53s
$ kubectl -n kubeflow get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
ambassador ClusterIP 10.97.168.31 <none> 80/TCP 1m
ambassador-admin ClusterIP 10.99.5.81 <none> 8877/TCP 1m
centraldashboard ClusterIP 10.111.104.142 <none> 80/TCP 1m
k8s-dashboard ClusterIP 10.102.65.244 <none> 443/TCP 1m
tf-hub-0 ClusterIP None <none> 8000/TCP 1m
tf-hub-lb ClusterIP 10.101.15.28 <none> 80/TCP 1m
tf-job-dashboard ClusterIP 10.106.133.49 <none> 80/TCP 1m
Setup port forwarding for the central dashboard UI and Jupyter Hub
$ POD=`kubectl -n kubeflow get pods --selector=service=ambassador | awk '{print $1}' | tail -1`
$ kubectl -n kubeflow port-forward $POD 8080:80 2>&1 >/dev/null &
$ POD=`kubectl -n kubeflow get pods --selector=app=tf-hub | awk '{print $1}' | tail -1`
$ kubectl -n kubeflow port-forward $POD 8000:8000 2>&1 >/dev/null &
Now you can access the Kubeflow dashboard at http://localhost:8080/ and JupyterHub at http://localhost:8000/. For JupyterHub, you’ll be landing on a login page.
If the page doesn’t refresh, please see troubleshooting.
To further customize your Kubeflow deployment you can copy the app to your local machine
kubectl cp kubeflow-admin/kubeflow-bootstrapper-0:/opt/bootstrap/default ~/my-kubeflow
Refer to the guide.