Guys, when exposing a deployment on node ip, we have hostPort, targerPort and po . . .

Alex Tsmokalyuk:
guys, when exposing a deployment on node ip, we have hostPort, targerPort and port. Considering the fact that service is virtual object and is just a set of forwarding rules, what does “port” serve for? As I understood, client request comes to hostPort and forwarded to target port.

Radoslaw Czajkowski:
when exposing a service as a nodeport type, logically it is as if two services were created - one for external traffic (listening on a nodeport) and the other for internal traffic (clusterip) - port is the port that the internal service “listens” on - it forwards traffic to the target port (to some pod)

Radoslaw Czajkowski:
so from external traffic to reach some pod the rules would be created in nat tables to receive traffic on a host port (that is nodeport) then forward it to the port of the internal service (that is port) and then forward it to the pod (that is targetport)