<p>I have a workload which is exposed through <code>NodePort</code> service with the name <code>online-forms-lib-service</code>. This workload has the <code>/version</code> route.</p>

<p>Also I have the following ingress:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: test-ingress
spec:
  rules:
  - host: example.com
    http:
      paths:
      - backend:
          serviceName: online-forms-lib-service
          servicePort: 80
        path: /formslib/
</code></pre>

<p>The problem is, the <code>/version</code> route is not available at:</p>

<pre><code>example.com/formslib/version
</code></pre>

<p>How to solve this?</p>

<p><strong>Update</strong> </p>

<p>It goes to the application root when I call: </p>

<pre><code>example.com/formslib/
</code></pre>

<p>Adding any path from there directs me to the default backend</p>

<p><strong>Update</strong>
Added the annotation: </p>

<pre><code>  annotations:
    ingress.kubernetes.io/rewrite-target: /
</code></pre>

<p>Still the same behaviour.</p>

<p>Actually, <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/#what-is-ingress" rel="nofollow noreferrer">Ingress</a> resource mostly relies on the <a href="https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/" rel="nofollow noreferrer">Ingress controller</a> implemented in K8s cluster with the aim to propagate Ingress rules and supplying load-balancing and traffic routing features. </p>

<p>As @ Utku Özdemir mentioned in the comment, most of the cloud providers on the market propose native Ingress controllers support, i.e. <a href="https://github.com/kubernetes/ingress-gce" rel="nofollow noreferrer">Ingress-gce</a> in <em>Google Cloud</em>, making possible to create External <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/ingress" rel="nofollow noreferrer">HTTP(S) load balancer</a> via particular Ingress resource.</p>

<p>In addition, you might find a lot of third party Ingress controllers <a href="https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/#additional-controllers" rel="nofollow noreferrer">solutions</a>, that can potentially expand <em>L7 network traffic</em> functionality depending on the client needs.</p>

<p>I've checked your current Ingress configuration in a similar scenario, and I've managed a proper sub-path routing adopting wildcard <code>*</code> matching rule, preceding the root application path for the particular backend service:</p>

<pre><code>- backend:
    serviceName: online-forms-lib-service
    servicePort: 80
    path: /formslib/*
</code></pre>
