<p>I am no kind of networking genius, and I am a Kubernetes rookie.  (What could possibly go wrong?)</p>

<p>At work, I am often behind a VPN.  I have found that <code>minikube</code> operations hang attempting to connect to my <code>minikube</code>-installed Kubernetes cluster (I'm using VirtualBox on a Mac).  When I disconnect from the VPN, everything works fine.</p>

<p>I've tried invoking <code>minikube</code> using something like <code>env http_proxy=foo.bar.com https_proxy=foo.bar.com minikube whatever</code> while on the VPN, but this merely reports that the network is unreachable (hey, at least it's not a hang).</p>

<p>This exhausts my staggering expertise in these two areas.  :-)</p>

<p>Since it is merely an inconvenience, I find myself often disconnecting from and reconnecting to the VPN throughout the day, but I hate magic.  Why am I encountering this behavior, and what can I do to fix it?</p>

<p>It is the docker daemon inside minikube that can't connect to the internet. </p>

<p>If your VPN enforces a proxy then you need to start it with some docker environment variables. This is how I do it. It is dependent on the environment in my shell but you'll get the idea.</p>

<pre><code>minikube start --docker-env HTTP_PROXY=$http_proxy --docker-env HTTPS_PROXY=$https_proxy
</code></pre>

<p>To access my minikube with kubectl I also have to add it's ip to NO_PROXY</p>

<pre><code>export NO_PROXY=$NO_PROXY,$(minikube ip)
export no_proxy=$no_proxy,$(minikube ip)
</code></pre>
