Minikube
- Part of the Kubernetes ecosystem
- “Minikube is a lightweight Kubernetes implementation that creates a VM on your local machine and deploys a simple cluster containing only one node.”
Need these:
- 2 CPUs or more
- 2GB of free memory
- 20GB of free disk space
- docker ( or other container or vm manager )
Install Minikube:
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb
sudo dpkg -i minikube_latest_amd64.deb
Start cluster:
minikube start
Access cluster with mini kubectl:
kubectl get po -A # if you already have kubectl
minikube kubectl -- get po -A # have minikube install kubectl
Create an alias for kubectl:
~/.bashrcalias kubectl="minikube kubectl --"
Source it to apply imediately:
source ~/.bashrc
Start dashboard:
minikube dashboard
Create and expose hello world deployment:
kubectl create deployment hello-minikube --image=kicbase/echo-server:1.0
kubectl expose deployment hello-minikube --type=NodePort --port=8080
… wait for it to start ….
Check it:
kubectl get services hello-minikube
Let minikube launch a browser:
minikube service hello-minikube
Forward the port:
kubectl port-forward service/hello-minikube 7080:8080
Access it here: http://localhost:7080/
minikube pause # pause cluster
minikube unpause # unpause cluser
minikube stop # stop cluster
minikube config set memory 9001 # change default memory limit
minikube addons list # see service catalog
Run another cluster with a specific ( old ) version:
minikube start -p aged --kubernetes-version=v1.16.1
Delete all clusters:
minikube delete --all