Install kubectl and minikube on Mac OS

Cover image

UPDATE: Docker can also help you run a Kubernetes cluster locally, check the Docker documentation to get started:

Install Google Cloud CLI tool

GCloud Quickstart MacOS

Install kubectl

$ gcloud components install kubectl

Install minikube

$ curl -Lo minikube && chmod +x minikube && sudo mv minikube /usr/local/bin/

Install minikube hyperkit driver

$ curl -LO \
&& sudo install -o root -g wheel -m 4755 docker-machine-driver-hyperkit /usr/local/bin/

Configure minikube to use hyperkit driver

$ minikube config set vm-driver hyperkit

Start minikube

$ minikube start

Run a test

$ kubectl run hello-minikube --port=8080
$ kubectl expose deployment hello-minikube --type=NodePort
$ kubectl get pods