$ brew update && brew install kubectl && brew cask install docker minikube virtualbox
$ brew cask reinstall minikube
$ minikube delete
$ rm -fr ~/.minikube/
* virtualbox
* vmwarefusion
* kvm2
* kvm
* hyperkit
$ minikube config set memory 8192
$ minikube config set cpus 4
$ minikube config set vm-drive vmwarefusion
$ minikube config view
$ minikube start --memory 8192 --cpus 4
$ minikube config view
- WantReportError: true
- cpus: 4
- ingress: true
- memory: 8192
$ minikube start --vm-driver virtualbox
$ minikube start --vm-driver hyperkit --memory 8192 --cpus 2
You can supply the kubernetes version you want minikube to start by mentioning the --kubernetes-version
$ minikube start --kubernetes-version v1.13.0
$ cat ~/.minikube/machines/minikube/config.json
$ ssh -i ~/.minikube/machines/minikube/id_rsa docker@$(minikube ip)
$ ssh minikube
$ minikube docker-env
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.64.7:2376"
export DOCKER_CERT_PATH="/Users/Username/.minikube/certs"
export DOCKER_API_VERSION="1.35"
# Run this command to configure your shell:
# eval $(minikube docker-env)
$ cd /Users/rcherara/Projects-Minikube/rcherara-api-book/
$ docker build --file=Dockerfile --tag=rcherara-api-book:latest --rm=true
$ kubectl run rcherara-api-book --image=rcherara-api-book:latest --port=7680 --image-pull-policy Never
$ kubectl config use-context CONTEXT_NAME
$ kubectl config use-context minikube
# for more info https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/
$ kubectl config get-contexts
$ kubectl get pod,svc -n kube-system
$ minikube docker-env export DOCKER_TLS_VERIFY="1" export DOCKER_HOST="tcp://192.168.64.7:2376" export DOCKER_CERT_PATH="/Users/Username/.minikube/certs" export DOCKER_API_VERSION="1.35" # Run this command to configure your shell: # eval $(minikube docker-env)
$ minikube logs
$ kubectl describe nodes
$ kubectl cluster-info
$ minikube dashboard
$ minikube service [-n NAMESPACE] [--url] NAME
$ minikube addons enable ingress
$ minikube ip
$ kubectl run hello-minikube --image=k8s.gcr.io/echoserver:1.10 --port=8080
$ kubectl expose deployment hello-minikube --type=NodePort
We have now launched an echoserver pod but we have to wait until the pod is up before curling/accessing it via the exposed service.
$ kubectl get pod
$ curl $(minikube service hello-minikube --url)
$ kubectl create namespace rcherara
$ kubectl run my-nginx --image=nginx --port=80
$ kubectl expose deployment my-nginx --type=NodePort
$ Kubectl scale --replicas=3 deployment/my-nginx
$ minikube stop
This command shuts down the Minikube Virtual Machine, but preserves all cluster state and data. Starting the cluster again will restore it to it’s previous state
Helm is a tool that streamlines installing and managing Kubernetes applications. Think of it like apt/yum/homebrew for Kubernetes.
$ brew install kubernetes-helm
$ helm init
$ helm repo update
$ helm install stable/drupal
$ helm install stable/wordpress
$ helm install --name my-release stable/jenkins
$ helm install
--name cert-manager
--namespace kube-system
stable/cert-manager
Note : If your cluster does not use RBAC (Role Based Access Control), you will need to disable creation of RBAC resources by adding --set rbac.create=false to your helm install command above.
$ curl -L -o ~/bin/helmfile https://github.com/roboll/helmfile/releases/download/v0.17.0/helmfile_darwin_amd64
$ chmod +x ~/bin/helmfile
Minikube documentation at : https://kubernetes.io/docs/getting-started-guides/minikube/
minikube source on GitHub : https://github.com/kubernetes/minikube