Skip to content

Instantly share code, notes, and snippets.

@ryan-williams
Last active October 1, 2019 04:18
Show Gist options
  • Save ryan-williams/5a4df391f26ea8223298bfab4fce7fa3 to your computer and use it in GitHub Desktop.
Save ryan-williams/5a4df391f26ea8223298bfab4fce7fa3 to your computer and use it in GitHub Desktop.
Instructions for running Kubeflow Pipelines on Minikube, locally on macOS

Supplemental to Kubeflow Pipelines' docs about using Minikube.

Set up minikube

See Minikube docs.

Install minikube

brew install minikube

Start minikube

minikube start --cpus 4 --memory 8096 --disk-size=40g --vm-driver=hyperkit

I tried running with lower values (IIRC, the defaults: 2 CPUs, 4G RAM, 20G disk) and lots of things failed (cf. minikube#4749).

Sanity check:

minikube status
host: Running
kubelet: Running
apiserver: Running
kubectl: Correctly Configured: pointing to minikube-vm at 192.168.64.3

Open dashboard in browser

minikube dashboard

Set up Kubeflow Pipelines

A key step not mentioned in the docs seems to be this post-installation section in the AWS docs.

Between kfctl generate all -V and kfctl apply all -V (cf. Deploying Kubeflow docs), while in your ${KFAPP} directory, run:

cat <<EOF >profile.yaml
apiVersion: kubeflow.org/v1alpha1
kind: Profile
metadata:
  name: sample-user
spec:
  owner:
    kind: User
    name: sample-user
EOF
kubectl apply -f profile.yaml

otherwise your kfctl apply all -V will hang, printing:

WARN[0016] Could not find namespace kubeflow-anonymous, wait and retry: namespaces "kubeflow-anonymous" not found  filename="kustomize/kustomize.go:353"
WARN[0020] Could not find namespace kubeflow-anonymous, wait and retry: namespaces "kubeflow-anonymous" not found  filename="kustomize/kustomize.go:353"
WARN[0026] Could not find namespace kubeflow-anonymous, wait and retry: namespaces "kubeflow-anonymous" not found  filename="kustomize/kustomize.go:353"
…

If you run into this issue, simply applying kubectl apply -f profile.yaml (cf. above) and re-running kfctl apply all -V will see the latter fail (applying some istio components is apparently not idempotent); you'll see a failure like:

INFO[0001] creating Service/istio-ingressgateway         filename="kustomize/kustomize.go:447"
Error: couldn't apply KfApp:  (kubeflow.error): Code 500 with message: kfApp Apply failed for kustomize:  (kubeflow.error): Code 500 with message: couldn't create resources from istio-install Error: Service "istio-ingressgateway" is invalid: spec.ports[1].nodePort: Invalid value: 31380: provided port is already allocated

The easiest fix seems to be to explicitly delete+recreate the istio components. The following seems to be sufficient:

kubectl -n istio-system delete deployments,jobs,pods,svc --all

Re-running kfctl apply all -V should succeed after that, and the final kubeflow+minikube instruction will set up your Kubeflow Pipelines web UI at http://localhost:8080/_/pipeline/:

kubectl port-forward -n istio-system svc/istio-ingressgateway 8080:80

🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment