I am new to kubernetes and I am trying to understand how kubernetes networking works when we have NodePort exposing a port for the outside world.
Let's imagine we have two nodes in our kubernetes cluster, call it Node1 and Node2. We have one pod deployed on Node2.
Then we create a NodePort service for this pod. For simplicity lets assume all ports (targetPort, nodePort, port) are 3000. Now a packet comes to Node1's port 3000 (where there is no pod deployed). As far as I understand, iptables rules dictate that this packet goes to the pod on Node2. My question is what ip does the pod see when it receives the packet and how its response packet goes back to our initial client from outside world.