<p>I know minikube should be used for local only, but i'd like to create a test environment for my applications.<br />
In order to do that, I wish to expose my applications running inside the minikube cluster to external access (from any device on public internet - like a 4G smartphone).</p>
<p><strong>note :</strong> I run minikube with <code>--driver=docker</code></p>
<p><strong>kubectl get services</strong></p>
<pre><code>NAME      TYPE       CLUSTER-IP     EXTERNAL-IP   PORT(S)          AGE
web8080   NodePort   10.99.39.162   &lt;none&gt;        8080:31613/TCP   3d1h
</code></pre>
<p><strong>minikube ip</strong></p>
<pre><code>192.168.49.2
</code></pre>
<p>One way to do it is as follows :</p>
<pre><code>firewall-cmd --add-port=8081/tcp
kubectl port-forward --address 0.0.0.0 services/web8080 8081:8080
</code></pre>
<p>then I can access it using :</p>
<pre><code>curl localhost:8081      (directly from the machine running the cluster inside a VM)
curl 192.168.x.xx:8081   (from my Mac in same network - this is the private ip of the machine running the cluster inside a VM)
curl 84.xxx.xxx.xxx:8081 (from a phone connected in 4G - this is the public ip exposed by my router)
</code></pre>
<p>I don't want to use this solution because <code>kubectl port-forward</code> is weak and need to be run every time the port-forwarding is no longer active.</p>
<p>How can I achieve this ?</p>
<p><strong>(EDITED) - USING LOADBALANCER</strong></p>
<p>when using <code>LoadBalancer</code> type and <code>minikube tunnel</code>, I can expose the service only inside the machine running the cluster.</p>
<p><strong>kubectl get services</strong></p>
<pre><code>NAME         TYPE           CLUSTER-IP      EXTERNAL-IP     PORT(S)          AGE
my-service   LoadBalancer   10.111.61.218   10.111.61.218   8080:31831/TCP   3d3h
</code></pre>
<p><code>curl 10.111.61.218:8080</code> (inside the machine running the cluster) is working<br />
but <code>curl 192.168.x.xx:8080</code> (from my Mac on same LAN) is not working</p>
<p>Thanks</p>

<p><code>curl $(minikube ip):$NODE_PORT</code> : Now we can test that the app is exposed outside of the cluster using curl, the IP of the Node and the externally exposed port.</p>
<p>For you : <code>curl 192.168.49.2:31613</code></p>
