<p>I have a service in Kubernetes which I have to expose on multiple ports over HTTP.
I use Nginx-Ingress and was able to expose my service over Port 80 successfully.(<code>http://serviceA.example.com --&gt; service-a:80</code>)</p>

<p>However I am not able to use a diffrent port for Http then Port 80.
How can I tell nginx-ingress to listen on Port 7049 aswell.</p>

<p>I've already tried to expose Port 7049 on the nginx Service and added the annotation <code>nginx.org/listen-ports: "80,7049"</code> to the nginx controller. Neither worked for me.</p>

<p>I expect the following output:</p>

<pre><code>http://serviceA.example.com --&gt; service-a:80

http://serviceA.example.com:7049 --&gt; service-a:7049
</code></pre>

<p>ingress-service.yml</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: nginx-ingress
  namespace: nginx-ingress
spec:
  externalTrafficPolicy: Local
  type: LoadBalancer
  ports:
  - port: 80
    targetPort: 80
    protocol: TCP
    name: http
  - port: 443
    targetPort: 443
    protocol: TCP
    name: https
  selector:
    app: nginx-ingress
</code></pre>

<p>my-service.yml</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: my-service
  labels:
    app: my-service
spec:
  ports:
  - port: 80
    targetPort: 80
    protocol: TCP
    name: http
  - port: 443
    targetPort: 443
    protocol: TCP
    name: https
  - port: 7049
    targetPort: 7049
    name: symbols
  selector:
    app: my-service
</code></pre>

<p>my-service-ingress.yml</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: my-service
spec:
  rules:
  - host: myservice.example.com
    http:
      paths:
      - path: /
        backend:
          serviceName: my-service
          servicePort: 80
</code></pre>

meilel
<p>Ingress Object is used to expose application <strong>only</strong> for HTTP and HTTPS Traffic. </p>

<blockquote>
  <p>Ingress, added in Kubernetes v1.1, exposes HTTP and HTTPS routes from outside the cluster to services within the cluster. Traffic routing is controlled by rules defined on the Ingress resource.</p>
</blockquote>

<p><a href="https://kubernetes.io/docs/concepts/services-networking/ingress/#what-is-ingress" rel="nofollow noreferrer">what-is-ingress</a></p>

<p>You can have different type of routing such as path based or hostname based routing but the port  number for the nginx will be 80 or&amp; 443.</p>

<p>If you want to expose  your application on different port than 80 and 443 , you need to use <a href="https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer" rel="nofollow noreferrer">LoadBalancer</a> type service</p>
