<p>I have the bare metall kubernetes pod running tomcat application on port 8085. If it would be common server, the app would be accessible via <code>http://&lt;server-ip&gt;:8085/app</code>. My goal is to expose the tomcat on Kubernetes node's address and the same port as used in tomcat.</p>

<p>I am able to expose and access app using Node Port service - but it is inconvenient that port is always different.
I tried to setup traefik ingress:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: test-tag2
spec:
  rules:
    - host: kubernetes.example.com #in my conf I use node's domain name
      http:
        paths:
        - path: /test
          backend:
            serviceName: test-tag2
            servicePort: 8085
</code></pre>

<p>And I can see result in Traefik's dashboard, but still if I navigate to <code>http://kubernetes.example.com/test/app</code> I get nothing.</p>

<p>I've tried a bunch of ways to configure that and still no luck.
Is it actually possible to expose my pod in this way?</p>

Anton
<p>Did you try specifying a nodePort value in the service yaml? If specified, kubernetes will create service on the specified NodePort. If the nodePort is not available , kubernetes doesn't create the service. </p>

<p>Refer to this answer for more details:
<a href="https://stackoverflow.com/a/43944385/1237402">https://stackoverflow.com/a/43944385/1237402</a></p>
