<p>Is it possible to have my development machine to be part of Minikube's network? </p>

<p>Ideally, it should work both ways:</p>

<ul>
<li>While developing an application in my IDE, I can access k8s resources inside Minikube using the same addressing that pods would use.</li>
<li>Pods running in Minikube can access my application running in the IDE, for example via HTTP requests.</li>
</ul>

<p><a href="https://stackoverflow.com/questions/35738500/google-container-engine-and-vpn">This</a> sounds like the first part is feasible on GCE using network routes, so I wonder if it's doable locally using Minikube.</p>

<p>There is an issue open upstream (<a href="https://github.com/kubernetes/minikube/issues/38" rel="noreferrer">kubernetes/minikube#38</a>) in order to discuss that particular use case. </p>

<p><code>kube-proxy</code> already adds the IPtables rules needed for IP forwarding inside the <code>minikube</code> VM (this is not specific to minikube), so all you have to do is add a static route to the container network via the IP of minikube's eth1 interface on your local machine:</p>

<pre><code>ip route add 10.0.0.0/24 via 192.168.42.58 (Linux)
route -n add 10.0.0.0/24 192.168.42.58     (macOS)
</code></pre>

<p>Where <code>10.0.0.0/24</code> is the container network CIDR and <code>192.168.42.58</code> is the IP of your minikube VM (obtained with the <code>minikube ip</code> command).</p>

<p>You can then reach Kubernetes services from your local environment using their cluster IP. Example:</p>

<pre><code>❯ kubectl get svc -n kube-system kubernetes-dashboard
NAME                   CLUSTER-IP   EXTERNAL-IP   PORT(S)        AGE
kubernetes-dashboard   10.0.0.56    &lt;nodes&gt;       80:30000/TCP   35s
</code></pre>

<p><a href="https://i.stack.imgur.com/N01di.png" rel="noreferrer"><img src="https://i.stack.imgur.com/N01di.png" alt="kubedash"></a></p>

<p>This also allows you to resolve names in the <code>cluster.local</code> domain via the cluster DNS (<code>kube-dns</code> addon):</p>

<pre><code>❯ nslookup kubernetes-dashboard.kube-system.svc.cluster.local 10.0.0.10
Server:     10.0.0.10
Address:    10.0.0.10#53

Name:   kubernetes-dashboard.kube-system.svc.cluster.local
Address: 10.0.0.56
</code></pre>

<p>If you also happen to have a local <code>dnsmasq</code> running on you local machine you can easily take advantage of this and forward all DNS requests for the <code>cluster.local</code> domain to <code>kube-dns</code>:</p>

<pre><code>server=/cluster.local/10.0.0.10
</code></pre>
