A Kubernetes Service can have a targetPort and port in the service definition:
kind: Servi
This answer is to reference Kubernetes' documentation in addition to the other answers:
https://kubernetes.io/docs/concepts/services-networking/connect-applications-service/:
targetPort: is the port the container accepts traffic on,
port: is the abstracted Service port, which can be any port other pods use to access the Service
https://kubernetes.io/docs/concepts/services-networking/service/:
Port definitions in Pods have names, and you can reference these names in the
targetPortattribute of a Service. This works even if there is a mixture of Pods in the Service using a single configured name, with the same network protocol available via different port numbers.