简体   繁体   中英

How to use proxy in Minikube on Ubuntu VM?

On an Ubuntu VM (running on Windows) I would like to install Minikube. My PC in running behind a corporate proxy. Using Proxifier I manage to access Internet and run Docker on Ubuntu. Unfortunately it looks like Minikube can't reach the internet...

minikube start
Starting local Kubernetes v1.9.4 cluster...
Starting VM...
Downloading Minikube ISO

The ISO can't be downloaded but it runs into a TLS handshake timeout...

You mentioned you could establish proxy using Proxifier. So, you could possibly try something like this to force Minikube use Proxifier proxy as well

export NO_PROXY="$NO_PROXY,192.168.0.0/16" # set the no_proxy env variable in the current shell.
minikube start --docker-env "HTTPS_PROXY=http://proxy:808" --docker-env "HTTP_PROXY=http://proxy:808" --docker-env "NO_PROXY=localhost,127.0.0.1,192.168.0.0/16" # start minikube and pass the same no_proxy setting to docker

Specifying 192.168.0.0/16 as the range of ipaddresses that shouldn't go through the proxy as this is the range (I think) that minikube generate it's IP addresses in (and I'm certain that I don't have anything else in that range)

More details is available on Minikube's Github issue https://github.com/kubernetes/minikube/issues/2706

Minikube 1.0 (March 2019) now comes with PR 3834 : "Automatically propagate proxy environment variables to docker env"

Currently, our documentation recommends that users use:

minikube start \
--docker-env=HTTP_PROXY=$HTTP_PROXY \
--docker-env HTTPS_PROXY=$HTTPS_PROXY \
 --docker-env NO_PROXY=$NO_PROXY

This makes the setting of --docker-env automatic if the environment variables are set.

Implemented in PR 3835 : "Plumb HTTP proxy configuration from host into VM environment"

Detect system proxy configuration from environment, and plumb them into the docker env and /etc/environment within the VM by default.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM