<p>I have run a Hello World application using the below command.</p>

<p><code>kubectl run hello-world --replicas=2 --labels="run=load-balancer-example" --image=gcr.io/google-samples/node-hello:1.0  --port=8080</code></p>

<p>Created a service as below</p>

<p><code>kubectl expose deployment hello-world --type=NodePort --name=example-service</code></p>

<p>The pods are running</p>

<pre><code>NAME                          READY   STATUS    RESTARTS   AGE
hello-world-68ff65cf7-dn22t   1/1     Running   0          2m20s
hello-world-68ff65cf7-llvjt   1/1     Running   0          2m20s
</code></pre>

<p>Service:</p>

<pre><code>NAME              TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
example-service   NodePort    10.XX.XX.XX     &lt;none&gt;        8080:32023/TCP   66s
</code></pre>

<p>Here, I am able to test it through curl inside the cluster.</p>

<pre><code>curl http://10.XX.XX.XX:8080
Hello Kubernetes!
</code></pre>

<p>How can I access this service outside my cluster? (example, through laptop browser)</p>

<p>you shoud try  </p>

<p><a href="http://IP_OF_KUBERNETES:32023" rel="nofollow noreferrer">http://IP_OF_KUBERNETES:32023</a></p>

<p>IP_OF_KUBERNETES can be your master IP your worker IP
when you expose a port in kubernetes .It expose that port in all of your server in cluster.Imagine you have two worker node with IP1 and IP2
and one pode is running in IP1  and in worker2 there is no pods but you can access your pod by</p>

<p><a href="http://IP1:32023" rel="nofollow noreferrer">http://IP1:32023</a></p>

<p><a href="http://IP2:32023" rel="nofollow noreferrer">http://IP2:32023</a></p>
