<p>I created a nodeport service on a port 12345, to access my api running on node 6666, deployed through a pod. The pod is deployed in multiple nodes.</p>
<pre><code> ports:
   - port: 8181
     targetPort: 6666
     nodePort: 12345
     protocol: TCP
</code></pre>
<p>In order to get the ip of the node, by running</p>
<pre><code>   kubectl get nodes -o wide
</code></pre>
<p>the internal / external ip of the node was obtained.
Thus, the resulting curl command is</p>
<pre><code>   http://&lt;node internal ip&gt;:12345/
</code></pre>
<p>The issue is that this is circulating all the nodes, running through the open port, everytime a ping is done.</p>
<p>How can I ensure that the ping, using the internal ip only hits one node and the pod service running on it?</p>
<p>Thanks in advance.!!</p>

Lakshmi Narayanan
<p>I was able to solve the above issue by adding the</p>
<pre><code> externalTrafficPolicy: &quot;Local&quot;
</code></pre>
<p>In the service definition. This way, the ping to the ip of the node, and to the api, did not go to other nodes, but rather was restricted locally to the node.</p>
