Skip to content

Instantly share code, notes, and snippets.

@mcastelino
Last active February 20, 2019 04:00
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save mcastelino/59fc5fa0a5697c49d0c0c852d6db89d7 to your computer and use it in GitHub Desktop.
Save mcastelino/59fc5fa0a5697c49d0c0c852d6db89d7 to your computer and use it in GitHub Desktop.
HOWTO: minikube behind a proxy

https://github.com/kubernetes/minikube

Note: Ensure that you have an active default virtual machine network setup on your machine. This can be verified using

virsh net-list 

You should see something along the lines of

Name                 State      Autostart     Persistent
---------------------------------------------------------- 
default              active     yes            yes

Ensure that it is a NAT network that gives external (internet connectivity)

virsh net-dumpxml default

You should see an entry that say

<forward mode='nat'>

To get it running behind the a proxy you need to setup things a bit differently from the documentation

  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

  2. Get the IP that the VM gets

    minikube ip

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

    export no_proxy="127.0.0.1,[minikube_ip]"

  4. Now kick off the POD and test is

    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)

  5. Cleanup the cluster minikube stop minikube delete

@pmatety
Copy link

pmatety commented May 1, 2017

@mcastelino Thanks for the steps. After deployment my pod doesn't start. I am using the example hello-minikube

root@ubuntu:~# kubectl get pod
NAME                             READY     STATUS              RESTARTS   AGE
hello-minikube-938614450-0rqr4   0/1       ContainerCreating   0          47m

unable to pull sandbox image "gcr.io/google_containers/pause-amd64:3.0": Error response from daemon: Get https://gcr.io/v1/_ping: http: error connecting to proxy

@mcastelino
Copy link
Author

@Rev1408 looks like the "default" network may be missing. You will need to create the virtual machine default network. Let me add that to the requirement.

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