How targetPort resolves
A numeric targetPort sends traffic to that port on the pod, whether or not a containerPort declares it, because containerPort is informational. A named targetPort is looked up per pod among the container port names. If no container declares that name, the Service has no usable endpoint for that port.
Omitting targetPort means it equals port. A quoted number such as "8080" is a port name, not a number, and fails name validation.
Questions
When do Service ports need names?
When a Service has more than one port, every port must be named. Names must be lowercase DNS labels.
What does a headless Service do?
With clusterIP: None, DNS returns the pod IPs directly instead of a virtual IP. StatefulSets need one for stable per-pod DNS names.