0

I am trying to use Ingress in minikube by minikube addons enable ingress. However, currently Ingress cannot be used with minikube when the driver is docker on macOS based on this issue ticket.

So I turn to use hyperkit or virtualbox as driver. One image that need to be pulled when enabling Ingress is k8s.gcr.io/ingress-nginx/controller:v0.44.0. However, k8s.gcr.io is blocked in my current location.

So I try to use a VPN in global mode for my computer. However, I met this issue that hyperkit is unable to access k8s.gcr.io when the VPN is in use.

Then I found this document https://minikube.sigs.k8s.io/docs/handbook/vpn_and_proxy/

My VPN is listening at 127.0.0.1:1087, I set

export HTTP_PROXY=http://127.0.0.1:1087
export HTTPS_PROXY=https://127.0.0.1:1087
export NO_PROXY=localhost,127.0.0.1,10.96.0.0/12,192.168.99.0/24,192.168.39.0/24

Then I tried all these methods to start minikube:

minikube start --driver=hyperkit
minikube start --driver=virtualbox
minikube start --driver=hyperkit --docker-env HTTP_PROXY=http://127.0.0.1:1087 --docker-env HTTPS_PROXY=https://127.0.0.1:1087 --docker-env NO_PROXY=localhost,127.0.0.1,10.96.0.0/12,192.168.99.0/24,192.168.39.0/24

But I saw these messages:

  minikube v1.21.0 on Darwin 11.2.3
✨  Using the hyperkit driver based on user configuration
❗  Local proxy ignored: not passing HTTP_PROXY=http://127.0.0.1:1087 to docker env.
❗  Local proxy ignored: not passing HTTPS_PROXY=https://127.0.0.1:1087 to docker env.
  Starting control plane node minikube in cluster minikube
  Creating hyperkit VM (CPUs=2, Memory=6000MB, Disk=20000MB) ...
❗  Local proxy ignored: not passing HTTP_PROXY=http://127.0.0.1:1087 to docker env.
❗  Local proxy ignored: not passing HTTPS_PROXY=https://127.0.0.1:1087 to docker env.

and

  minikube v1.21.0 on Darwin 11.2.3
✨  Using the virtualbox driver based on existing profile
❗  Local proxy ignored: not passing HTTP_PROXY=http://127.0.0.1:1087 to docker env.
❗  Local proxy ignored: not passing HTTPS_PROXY=https://127.0.0.1:1087 to docker env.

Seems this "user configuration" overwrite my proxy config. But where is this "user configuration"?

What is the correct way to set proxy for minikube when the drive hyperkit or virtualbox? Thanks!

Hongbo Miao
  • 38,184
  • 54
  • 150
  • 228
  • How about downloading this image using docker, exporting it to file, transfering it to minikube VM and importing it to local docker registry, like in https://stackoverflow.com/a/23938978/15537201? – Jakub Siemaszko Jul 15 '21 at 11:11
  • Also, from https://github.com/kubernetes/minikube/issues/6296#issuecomment-579921953 it looks like only hyperkit is problematic, have you tried global VPN on virtualbox without any settings related to VPN on minikube? – Jakub Siemaszko Jul 15 '21 at 11:22
  • 1
    Thanks @JakubSiemaszko ! Transferring it to minikube VM sounds a good way! I did try minikube with virtualbox but got same issue. Feel free to post as an answer as it does help. – Hongbo Miao Jul 15 '21 at 17:39
  • Done, feel free to accept and upvote this answer if you find it helpful. – Jakub Siemaszko Jul 19 '21 at 14:29

2 Answers2

0

Downloading this image using docker, exporting it to file, transfering it to minikube VM and importing it to local docker registry, like in this thread has solved the problem.

Jakub Siemaszko
  • 549
  • 1
  • 7
0

My guess is 127.0.0.1 conflicts with the VM's internal 127.0.0.1 address, and that's why it's ignored. You might need to configure your proxy to be your host's network IP instead of 127.0.0.1? You might not even need to configure a proxy? Also, the Virtualbox driver gives me problems with VPN. I have the best luck with the VMware driver, and can also get the HyperKit driver to work if I update the VM's DNS to my host's DNS.

minikube start --driver hyperkit
minikube ssh sudo resolvectl dns eth0 192.168.0.53
minikube ssh sudo resolvectl domain eth0 example.com

I also get the unable to access k8s.gcr.io error when creating the VM, but it doesn't seem to affect things.

Jack Miner Ewes
  • 1,856
  • 1
  • 13
  • 11