Instantly share code, notes, and snippets.

Embed
What would you like to do?
# http://www.lotharschulz.info/2018/05/06/kubeflow-jupyter-notebook-on-kubernetes
# Create a namespace for kubeflow deployment
NAMESPACE=kubeflow
# start kubernetes cluster using minikube
minikube start
# create the kubeflow namespace
kubectl create namespace ${NAMESPACE}
# ksonnet package versions
VERSION=v0.1.3
# define app name
APP_NAME=my-kubeflow
# stop cluster to work around
minikube stop
# Initialize a ksonnet app.
ks init ${APP_NAME}
cd ${APP_NAME}
# Namespace for it's default environment.
ks env set default --namespace ${NAMESPACE}
# install kubeflow components
ks registry add kubeflow github.com/kubeflow/kubeflow/tree/${VERSION}/kubeflow
ks pkg install kubeflow/core@${VERSION}
ks pkg install kubeflow/tf-serving@${VERSION}
ks pkg install kubeflow/tf-job@${VERSION}
ks generate kubeflow-core kubeflow-core
# start cluster to prepare deployment
minikube start
# deploy kubeflow
ks apply default -c kubeflow-core
# enable port forwarding to jupyter server - access http://127.0.0.1:8100 in browser
kubectl port-forward tf-hub-0 8100:8000 --namespace=${NAMESPACE}
# optional: access minkube cluster dashboard at kubeflow namespace - http://192.168.99.100:30000/#!/overview?namespace=kubeflow
minikube dashboard
# optional: build a dummy model
$ ks generate tf-job my-tf-job --name=my-tf-job --image=gcr.io/tensorflow/tensorflow
$ ks apply default -c my-tf-job
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment