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.
ports:
- port: 8181
targetPort: 6666
nodePort: 12345
protocol: TCP
In order to get the ip of the node, by running
kubectl get nodes -o wide
the internal / external ip of the node was obtained. Thus, the resulting curl command is
http://<node internal ip>:12345/
The issue is that this is circulating all the nodes, running through the open port, everytime a ping is done.
How can I ensure that the ping, using the internal ip only hits one node and the pod service running on it?
Thanks in advance.!!