<p>I am trying to run the kubernetes service via NodePort.</p>
<p><a href="https://i.stack.imgur.com/TRzpu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TRzpu.png" alt="This is my node.js running" /></a></p>
<p><a href="https://i.stack.imgur.com/6QZtb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6QZtb.png" alt="This is my deployment file" /></a></p>
<p><a href="https://i.stack.imgur.com/Y9OBO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Y9OBO.png" alt="This is my service file" /></a></p>
<p><a href="https://i.stack.imgur.com/5p4E1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5p4E1.png" alt="Pods" /></a></p>
<p><a href="https://i.stack.imgur.com/fZxHJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fZxHJ.png" alt="Deployment running" /></a></p>
<p><a href="https://i.stack.imgur.com/XA7EB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XA7EB.png" alt="Services running" /></a></p>
<p><a href="https://i.stack.imgur.com/dWwkC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dWwkC.png" alt="Description of service running" /></a></p>
<p><a href="https://i.stack.imgur.com/BZ4v5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BZ4v5.png" alt="enter image description here" /></a></p>
<p>I can't figure out what the problem is when i try to hit <code>localhost:31553</code> on my device it is not listening there. Moreover I also tried with <code>10.101.184.102:31553</code> it also doesn't work.
I want to run it on localhost.
Please Help.</p>

Anurag Gupta
<p><code>10.101.184.102</code> is an IP within your SDN, you probably can't reach it from your workstation. It won't be listening on your loopback either (<code>localhost</code>). You need to connect to one of your Kubernetes nodes IP address, within your LAN, on the TCP port allocated to your NodePort Service. Eg:</p>
<pre><code>$ kubectl get nodes -o wide
NAME       STATUS                     ROLES    AGE    VERSION   INTERNAL-IP    EXTERNAL-IP   OS-IMAGE                       KERNEL-VERSION    CONTAINER-RUNTIME
compute1   Ready                      worker   243d   v1.18.3   10.42.253.20   &lt;none&gt;        Debian GNU/Linux 10 (buster)   4.19.0-10-amd64   containerd://1.2.13
....
$ curl http://10.42.253.20:31553
</code></pre>
<p>If running in some cloud-integrated Kubernetes, you'ld rather use the LoadBalancer Service type (see <a href="https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/" rel="nofollow noreferrer">docs</a>).</p>
