Skip to content

Instantly share code, notes, and snippets.

@rghv404
Last active January 26, 2022 18:13
Show Gist options
  • Save rghv404/6cc9be35c55a0f4d57a91a3a4fb53b58 to your computer and use it in GitHub Desktop.
Save rghv404/6cc9be35c55a0f4d57a91a3a4fb53b58 to your computer and use it in GitHub Desktop.
Install/Uninstall Minikube from MAC

Final Uninstall

minikube stop; minikube delete &&
rm -rf ~/.kube ~/.minikube &&
sudo rm -rf /usr/local/bin/localkube /usr/local/bin/minikube &&
launchctl stop '*kubelet*.mount' &&
launchctl stop localkube.service &&
launchctl disable localkube.service &&
sudo rm -rf /etc/kubernetes/ &&
docker system prune -af --volumes

Install Minikube

$ brew install docker-machine-driver-xhyve

# docker-machine-driver-xhyve need root owner and uid
$ 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
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-darwin-amd64 && \
chmod +x minikube && \
sudo mv minikube /usr/local/bin/
curl -LO https://storage.googleapis.com/minikube/releases/latest/docker-machine-driver-hyperkit \
&& chmod +x docker-machine-driver-hyperkit \
&& sudo mv docker-machine-driver-hyperkit /usr/local/bin/ \
&& sudo chown root:wheel /usr/local/bin/docker-machine-driver-hyperkit \
&& sudo chmod u+s /usr/local/bin/docker-machine-driver-hyperkit
minikube start --logtostderr --v=3 --vm-driver=hyperkit
minikube version
minikube ssh
$ docker version
kubectl config get-contexts

deploy a simple image

kubectl run hello-minikube --image=k8s.gcr.io/echoserver:1.4 --port=8080

expose the service outside the cluster

kubectl expose deployment hello-minikube --type=NodePort
minikube service hello-minikube --url

Dashboard

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