Skip to content

Instantly share code, notes, and snippets.

@driedtoast
Last active October 17, 2017 17:34
Show Gist options
  • Save driedtoast/3c765ff2b4a63ed191e5a1a47b6ebc85 to your computer and use it in GitHub Desktop.
Save driedtoast/3c765ff2b4a63ed191e5a1a47b6ebc85 to your computer and use it in GitHub Desktop.
Kubernetes Notes

##Setup## Setting up kubernetes locally references:

Setup minikube:

  • brew cask install minikube
  • brew install bash-completion
  • brew install kubectl ** brew upgrade kubernetes-cli - upgrade
  • brew 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, run sudo rm -rf ~/.minikube
  • minikube start

##Running## Minikube commands:

  • minikube start - Starts the cluster, use -v 7 for debugging startup
  • minikube stop - Stops the cluster
  • minikube status - Checks the status of a mini kube running
  • minikube 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 cluster
  • kubectl cluster-info - validate cluster
  • kubectl run hello-minikube --image=grc.io/google_container/echoserver:1.4 --port=8080 - run simple app
  • kubectl config use-context minikube - sets context at the global level

Troubleshooting

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