- minikube -
brew install $(brew search minikube)
- kubectl -
brew install kubernetes-cli
- jq -
brew install jq
- git clone this tutorial and cd into it
- do not change the console tab, because some commands depend on local environment variables.
brew install docker-machine-driver-xhyve
- pay attention to instructions at the end of installation! (execute two sudo commands)
minikube status
minikube stop ; minikube delete
minikube start --cpus 4 --memory 4096 --vm-driver=xhyve
ping $(minikube ip)
kubectl get pods --all-namespaces
minikube ssh 'docker run -d -p 5000:5000 --name registry registry:2'
eval $(minikube docker-env)
export KUBECONFIG=$(pwd)/kubeconfig
env | grep -E 'DOCKER|KUBE'
docker build -t localhost:5000/tutorial/hellonode .
docker push localhost:5000/tutorial/hellonode
kubectl run hello --image=localhost:5000/tutorial/hellonode --port=8080
# port 8080 is from Dockerfilekubectl expose deploy hello --port=80 --target-port=8080 --type=NodePort
minikube dashboard
kubectl get services -o wide
HELLO_PORT=$(kubectl get service/hello -o json | jq '.spec.ports[0].nodePort')
open http://$(minikube ip):$HELLO_PORT