The targetPort field tells a Kubernetes Service which port to use on the selected pods. A Service can accept traffic on one port and forward it to a different pod port. section 11.1.2
Forwarding Service traffic to port 80
In the quote Service, port 80 is both the Service-facing port and the targetPort. The selector chooses pods labeled app=quote, and each connection is forwarded to port 80 on a selected pod. section 11.1.2
Instead of a number, targetPort can name a port declared in the pod’s container port list. Named ports let the Service continue using the correct destination when pods use different port numbers. section 11.1.2
