title: Why ingress "servicePort" can be "port" and "targetPort" of service?
body: <p>Today I confronted with a misunderstanding about <code>servicePort</code>. </p>
  
  <p>I expected that service can be linked with ingress specifying only <code>servicePort: 80</code>, but both <code>servicePort: 80</code> and <code>servicePort: 8080</code> works.</p>
  
  <p>Can someone help me to understand why both ports <code>port</code> and <code>targetPort</code> are exposed by Service, not only <code>port</code>?</p>
  
  <p><em>Service (app)</em></p>
  
  <pre><code>spec:
    type: ClusterIP
    ports:
      - port: 80
        targetPort: 8080
  </code></pre>
  
  <p><em>Ingress (ingress-nginx)</em></p>
  
  <pre><code>spec:
    rules:
    - host: example.com
      http:
        paths:
        - path: /
          backend:
            serviceName: app
            servicePort: 8080
  </code></pre>