<p>I am running kubernetes on minikube, I am behind a proxy, so I had set the env variables(HTTP_PROXY &amp; NO_PROXY) for docker in /etc/systemd/system/docker.service.d/http-proxy.conf.
I was able to do docker pull but when I run the below example</p>

<pre><code>kubectl run hello-minikube --image=gcr.io/google_containers/echoserver:1.4 --port=8080
kubectl expose deployment hello-minikube --type=NodePort
kubectl get pod
</code></pre>

<p>pod never starts and I get the error</p>

<p><code>desc = unable to pull sandbox image \"gcr.io/google_containers/pause-amd64:3.0\"</code></p>

<p><code>docker pull gcr.io/google_containers/echoserver:1.4</code> works fine</p>

<p>I ran into the same problem and am sharing what I learned after making a couple of wrong turns. This is with minikube v0.19.0. If you have an older version you might want to update.</p>

<p>Remember, there are two things we need to accomplish:</p>

<ol>
<li>Make sure kubctl does not go through the proxy when connecting to minikube on your desktop.</li>
<li>Make sure that the docker daemon in minikube <em>does</em> go through the proxy when it needs to connect to image repositories.</li>
</ol>

<p>First, make sure your proxy settings are correct in your environment. Here is an example from my .bashrc:</p>

<pre><code>export {http,https,ftp}_proxy=http://${MY_PROXY_HOST}:${MY_PROXY_PORT}
export {HTTP,HTTPS,FTP}_PROXY=${http_proxy}
export no_proxy="localhost,127.0.0.1,localaddress,.your.domain.com,192.168.99.100"
export NO_PROXY=${no_proxy}
</code></pre>

<p>A couple things to note:</p>

<ol>
<li>I set both lower and upper case. Sometimes this matters.</li>
<li>192.168.99.100 is from <code>minikube ip</code>. You can add it after your cluster is started.</li>
</ol>

<p>OK, so that should take care of kubectl working correctly. Now we have the next issue, which is making sure that the Docker daemon in minikube is configured with your proxy settings. You do this, as mentioned by PMat like this:</p>

<pre><code>$ minikube delete
$ minikube start --docker-env HTTP_PROXY=${http_proxy} --docker-env HTTPS_PROXY=${https_proxy} --docker-env NO_PROXY=192.168.99.0/24
</code></pre>

<p>To verify that theses settings have taken, do this:</p>

<pre><code>$ minikube ssh -- systemctl show docker --property=Environment --no-pager
</code></pre>

<p>You should see the proxy environment variables listed.</p>

<p>Why do the <code>minikube delete</code>? Because without it the start won't update the Docker environment if you had previously created a cluster (say without the proxy information). Maybe this is why PMat did not have success passing --docker-env to start (or maybe it was on older version of minikube).</p>
