<p>I have created and deployed an application on ICP 2.1. Have exposed NodePort as my service. Iam able to navigate to the url from the Nodeport. How do i go to a specific path on the url directly from the Nodeport. Iam using yaml file to create the deployment and service. Where should i specify the path??</p>

vidya
<blockquote>
  <p>How do i go to a specific path on the url directly from the Nodeport</p>
</blockquote>

<p>The short version is that you don't, since a <code>NodePort</code> is merely an exposure of an existing <code>port:</code> from a <code>Service</code>.</p>

<p>The medium length version is that using an ingress controller (such as the "default" nginx one) would allow you to <a href="https://kubernetes.github.io/ingress-nginx/examples/rewrite/README/#app-root" rel="nofollow noreferrer">add an app-root</a> to the <code>Ingress</code> resource, and then use the <code>NodePort</code> belonging to the ingress controller rather than the <code>NodePort</code> of the upstream <code>Service</code> itself. I'm pretty sure <a href="https://kubernetes.github.io/ingress-nginx/ingress-controller-catalog/" rel="nofollow noreferrer">all of the ingress controllers</a> support that kind of behavior since it's a fairly common scenario.</p>

<p>The long version is that you can manually put something like <code>nginx</code> or <code>haproxy</code> between your <code>Service</code> and the upstream <code>Pod</code> to artificially inject a URI prefix, with the disadvantage that if you wish to do that more than once, you'd be better off using an <code>Ingress</code> resource so that functionality is handled for you in a standardized way.</p>
