##Setup## Setting up kubernetes locally references:
- (https://github.com/kubernetes/minikube)
- (https://deis.com/docs/workflow/quickstart/provider/minikube/boot/)
- Notes on usage with Docker for Mac
- Install for xhyve driver
Setup minikube:
brew cask install minikube
brew install bash-completion
brew install kubectl
**brew upgrade kubernetes-cli
- upgradebrew install docker-machine-driver-xhyve
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
minikube config set vm-driver xhyve
For VPN:
- Update gateway, edit
.minikube/machines/minikube/config.json
and setting the following: **"IPAddress": "10.254.254.1/24",
**"HostOnlyCIDR": "10.254.254.1/24",
- Remove routes for local network
sudo route delete 10.254.254.1/24 &> /dev/null
sudo route add 10.254.254.1/24 -iface vboxnet1 &> /dev/null
- i have a couple different virtual boxes running,vboxnet0
if only one
To change minikube setup:
minikube stop
- Make changes
minikube delete
** If really broken, runsudo rm -rf ~/.minikube
minikube start
##Running## Minikube commands:
minikube start
- Starts the cluster, use-v 7
for debugging startupminikube stop
- Stops the clusterminikube status
- Checks the status of a mini kube runningminikube ssh systemctl status localkube
- gets details on the running kube cluster
Kubectl commands:
kubectl get pods --context=minikube
- get a list of pods in the clusterkubectl cluster-info
- validate clusterkubectl run hello-minikube --image=grc.io/google_container/echoserver:1.4 --port=8080
- run simple appkubectl config use-context minikube
- sets context at the global level
Troubleshooting
- (kubernetes/minikube#1234) - unable to connect to server dialog
- (kubernetes/minikube#1099) - vpn issues