A Kubernetes cluster up and running (locally) in less than five minutes.

Unless for the last year you’ve been living under a rock, you’d know about Kubernetes. In a nutshell Kubernetes is a sophisticated container scheduler and solid orchestrator for scalable infrastructures. To a beginner the whole Kubernetes ecosystem and terminology might appear overwhelming. However, whether you would like to give a go to Kubernetes, the team behind it has developed Minikube, a tool that makes it easy to run Kubernetes locally. In this instalment I’m going to walk you thought from setting up Minikube and run a Docker image on top of a Kubernetes cluster.


brew https://brew.sh

xhyve https://github.com/mist64/xhyve


virtualbox https://www.virtualbox.org/wiki/Downloads

Installation and setup:

xhyve hypervisor (preferred way)

brew install docker-machine-driver-xhyve xhyve

sudo chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve

sudo chmod u+s $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve

minikube config set vm-driver xhyve

Virtualbox hypervisor

Skip this whether you have Virtualbox already installed: brew update && brew install caskroom/cask/virtualbox caskroom/cask/virtualbox-extension-pack

brew update && brew install kubectl caskroom/cask/minikube

minikube config set vm-driver virtualbox

Kubernetes cluster bootstrap:

minikube start


Cluster status check:

minikube status


Creating a flaskapp deployment.

kubectl run flaskapp --image=p0bailey/docker-flask:latest

kubectl get deployment


Get Kubernetes pods information:

kubectl get pod


Operating the cluster:

Exposing flaskapp using a load balancer service:

kubectl expose deployment flaskapp --type=LoadBalancer --port=80

Accessing the flask application.

minikube service flaskapp --url

Once the url gets generated, point your browser to it and enjoy your first Kubernetes setup.

Kubernetes internals:

To view the the kubernetes dashboard URL for your local cluster:

minikube dashboard