What Happened?
I’m running Minikube under a proxy on my WSL Ubuntu (running under Windows 11).
First of all, my Docker daemon works correctly. I set the proxy in /etc/docker/daemon.json, and docker pull commands work without issues.
Secondly, my Minikube is configured to use Docker as the driver.
Now, I start minikube with these commands :
$ export NO_PROXY=localhost,127.0.0.1,10.96.0.0/12,192.168.59.0/24,192.168.49.0/24,192.168.39.0/24
$ export HTTPS_PROXY=http://127.0.0.1:9000
$ export HTTP_PROXY=http://127.0.0.1:9000
$ minikube start --docker-env HTTPS_PROXY=http://127.0.0.1:9000 --docker-env HTTP_PROXY=http://127.0.0.1:9000 --docker-env NO_PROXY=$NO_PROXY
However, when I try to pull an image, such as nginx, I encounter the following error:
$ kubectl run nginx --image=nginx --image-pull-policy=Always
Warning Failed 69s (x4 over 2m42s) kubelet Failed to pull image "nginx": Error response from daemon: Get "https://registry-1.docker.io/v2/": proxyconnect tcp: dial tcp 127.0.0.1:9000: connect: connection refused
It seems that Minikube correctly uses the proxy at 127.0.0.1:9000. However, unlike Docker, I get a connection refused error for this proxy.
Attach the log file
logs.txt
Operating System
Ubuntu - WSL
Driver
Docker
I had the same issue.
My case:
I run a proxy on my laptop on 0.0.0.0:2080
and the minikube is running on my host docker container.
when I tried to ssh into the minikube and pull and image I got the same error.
Then after some debugging I found out that the address to proxy was not correct.
minikube could not connect to 127.0.0.1:2080
because there was no proxy running on localhost(minikube container)
So I passed this address to minikube when starting up the cluster.
192.168.1.4:2080
In my case the IP address to my laptop was 192.168.1.4
. You can get this address by executing this command ip addr
full command:
minikube start --docker-env HTTP_PROXY=http://192.168.1.4:2080 --docker-env HTTPS_PROXY=http://192.168.1.4:2080 --docker-env NO_PROXY=localhost,127.0.0.1,10.96.0.0/12,192.168.59.0/24,192.168.49.0/24,192.168.39.0/24
Finally the minikube could access the proxy and everything works fine now.
1 Like
Thanks for these explanations.
Indeed, I also saw on minikube’s github some issues talking about the fact that 127.0.0.1 can’t be taken as a proxy by minkube. Probably it’s not the same 127.0.0.1 as the host.
However, I’ve tried using different addresses as proxies, and I still have the problem. I’ve tried the address that corresponds to my laptop’s interface to the Internet (the default), and the address in 192 of my laptop on the local network. In both cases, same result.
For the moment it’s not too serious, I’ve found another way to get the images. But in the long run, it’s not practical to have a minikube that doesn’t have access to the Internet under a corporate proxy.