Kubectl: Kubernetes with minikube times out

To get it running behind the a proxy you need to setup things a bit differently from the documentation. a. You need to ensure that the docker daemon running with the VM can reach out to the internet via the proxy. b. You need to ensure kubectl running on the host can get to the VM without going out through the proxy

Using the default kubectl example

  1. Ensure that the proxy is passed into the VM that is created by minikube (this ensures that the docker daemon within the VM can get out to the internet)

minikube start --vm-driver="kvm" --docker-env="http_proxy=xxx" --docker-env="https_proxy=yyy" start

Note: Replace xxx and yyy with your proxy settings

  1. Get the IP that the VM gets at startup.

minikube ip

Note: You need to do this each time you setup minikube as it can change

  1. Ensure that kubectl can talk to this VM without going to the proxy

export no_proxy="127.0.0.1,[minikube_ip]"

  1. Now kick off the POD and test it

kubectl run hello-minikube --image=gcr.io/google_containers/echoserver:1.4 --port=8080

kubectl expose deployment hello-minikube --type=NodePort

kubectl get pod

curl $(minikube service hello-minikube --url)