<p>I'm trying get the hello-node service running and accesssible from outside on an azure VM with minikube.</p>

<blockquote>
  <p>minikube start --driver=virtualbox</p>
</blockquote>

<p>created deployment</p>

<blockquote>
  <p>kubectl create deployment hello-node --image=k8s.gcr.io/echoserver</p>
</blockquote>

<p>exposed deployment</p>

<blockquote>
  <p>kubectl expose deployment hello-node --type=LoadBalancer --port=8080</p>
</blockquote>

<p>suppose kubectl get services says:</p>

<blockquote>
  <p>hello-node   LoadBalancer 1.1.1.1 8080:31382/TCP</p>
</blockquote>

<p>The public IP of the azure VM is 2.2.2.2, the private IP is 10.10.10.10 and the virtualbox IP is 192.168.99.1/24</p>

<p>How can I access the service from a browser outside the cluster's network?</p>

Serve Laurijssen
<p>In your case, you need you to use --type=NodePort for creating a service object that exposes the deployment. The type=LoadBalancer service is backed by external cloud providers.</p>

<pre><code>kubectl expose deployment hello-node --type=NodePort --name=hello-node-service
</code></pre>

<p>Display information about the Service:</p>

<pre><code>kubectl describe services hello-node-service
</code></pre>

<p>The output should be similar to this:</p>

<pre><code>Name:                   example-service
Namespace:              default
Labels:                 run=load-balancer-example
Annotations:            &lt;none&gt;
Selector:               run=load-balancer-example
Type:                   NodePort
IP:                     10.32.0.16
Port:                   &lt;unset&gt; 8080/TCP
TargetPort:             8080/TCP
NodePort:               &lt;unset&gt; 31496/TCP
Endpoints:              10.200.1.4:8080,10.200.2.5:8080
Session Affinity:       None
Events:                 &lt;none&gt;
</code></pre>

<p>Make a note of the NodePort value for the service. For example, in the preceding output, the NodePort value is 31496.</p>

<p>Get the public IP address of your VM. And then you can use this URL:</p>

<pre><code>http://&lt;public-vm-ip&gt;:&lt;node-port&gt;
</code></pre>

<p>Don't forget to open this port in firewall rules.</p>
