<p>I'm trying to run a k8s cluster from behind a http proxy.  I am able to download images from the corresponding repositories, however when I try to provision the same using k8s I get <code>errImagePull</code>  For example if I try</p>
<pre><code>kubectl apply -f https://download.elastic.co/downloads/eck/1.5.0/all-in-one.yaml
</code></pre>
<p>Then I get the following error on the pod</p>
<pre><code> Normal   Pulling    37m (x4 over 38m)      kubelet            Pulling image &quot;docker.elastic.co/eck/eck-operator:1.5.0&quot;
  Warning  Failed     37m (x4 over 38m)      kubelet            Failed to pull image &quot;docker.elastic.co/eck/eck-operator:1.5.0&quot;: rpc error: code = Unknown desc = failed to pull and unpack image &quot;docker.elastic.co/eck/eck-operator:1.5.0&quot;: failed to resolve reference &quot;docker.elastic.co/eck/eck-operator:1.5.0&quot;: failed to do request: Head https://docker.elastic.co/v2/eck/eck-operator/manifests/1.5.0: proxyconnect tcp: dial tcp [::1]:3128: connect: connection refused
  Warning  Failed     37m (x4 over 38m)      kubelet            Error: ErrImagePull
</code></pre>
<p>Now when I directly try <code>docker image pull docker.elastic.co/eck/eck-operator:1.5.0</code> directly on the box it works fine.  I think I need to setup a http proxy for k8s, but not sure how to do that.</p>
<p>Any suggestions are welcome.  I'm using <code>kind</code> on my linux instance and <code>cntlm</code> is configured as well, hence my usage of localhost:3128 as proxy.</p>
<p>I also tried this using minikube with the following command</p>
<pre><code>minikube start --docker-env HTTP_PROXY=http://localhost:3128 --docker-env HTTPS_PROXY=http://localhost:3128 --docker-env no_proxy=localhost
</code></pre>
<p>I still get the same error</p>

tmp dev
<p>Assuming <code>localhost</code> is the <code>host</code> on which Docker is running to support <code>minikube</code> or <code>kind</code> based <code>Kubernetes</code> nodes, you need to use <code>host.docker.internal:3128</code> as the proxy, instead of <code>localhost:3128</code>. This <a href="https://github.com/docker/for-linux/issues/264" rel="nofollow noreferrer">issue</a> is relevant.</p>
<p>For <code>minikube</code>, <code>host.minikube.internal:3128</code> would also work. More information <a href="https://minikube.sigs.k8s.io/docs/handbook/host-access/" rel="nofollow noreferrer">here</a>.</p>
