New versions of Minikube and Kubernetes are released fairly frequently. Over time, you will probably end up needing to have multiple versions installed on your development machine. We recommend using the asdf package manager to make it very easy to switch between versions and manage installation.
brew install asdf
Edit your ~/.profile
or equivalent
[ -s "/usr/local/opt/asdf/asdf.sh" ] && . /usr/local/opt/asdf/asdf.sh
Follow the asdf installation instructions at https://github.com/asdf-vm/asdf
asdf plugin-add kubectl
asdf plugin-add minikube
We recommend starting with versions of minikube and kubectl that match what we test in TravisCI. After you have experience with OpenWhisk on Minikube, feel free to experiment with additional versions.
asdf install kubectl 1.9.0
asdf global kubectl 1.9.0
asdf install minikube 0.25.2
asdf global minikube 0.25.2
You will want at least 4GB of memory and 2 CPUs for Minikube to run OpenWhisk. If you have a larger machine, you may want to provision more (especially more memory).
minikube config set kubernetes-version v1.9.0
minikube config set cpus 2
minikube config set memory 4096
minikube config set WantUpdateNotification false
minikube start --extra-config=apiserver.Authorization.Mode=RBAC
Put the docker network in promiscuous mode.
minikube ssh -- sudo ip link set docker0 promisc on
Tip: Make sure to setup the Docker network after minkube start
if you ran minkube delete
as this configuration will be lost.
Your Minikube cluster should now be ready to deploy OpenWhisk.
To use a different version of Kubernetes with Minikube, you need to delete the VM, reconfigure minikube, restart, and redo the setup of the Docker network.
minikube delete
minikube config set kubernetes-version <NEW_VERSION>
minikube start --extra-config=apiserver.Authorization.Mode=RBAC
minikube ssh -- sudo ip link set docker0 promisc on
For some combinations of Minikube and Kubernetes versions, you may need to workaround a Minikube DNS issue. A common symptom of this issue is that the OpenWhisk couchdb pod will fail to start with the error that it is unable to resolve github.com
when cloning the openwhisk git repo. A work around is to delete the minikube cluster, issue the command minikube config set bootstrapper kubeadm
and then redo the minikube start
command above.