<p>We want to have 1 k8s cluster and to enable each developer to deploy their environment by separating developer's env by URI "/developerName", and an NS where every deployment of the app will be deployed on different NS.</p>

<p>The application is a legacy tomcat based web app.</p>

<p>I'm looking for a good approach where I can route the traffic of every developer based on URL to different deployments.</p>

<p>There is 1 restriction, where the application is expecting only the app name in the URL. 
i.e example.com/username/appname isn't working since the app is expecting only example.com/appname</p>

<p>I have deployed successfully Nginx ingress controller and checked it's working whenever I'm not using the "/developername" in the path</p>

Mickey Hovel
<p>You can use an ingress resource. Configure each environment with different hostname:</p>

<pre class="lang-yaml prettyprint-override"><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: ingress
  namespace: developer1
spec:
  rules:
    - host: developer1.mytestdomain.com
      http:
        paths:
          - backend:
              serviceName: my-tomcat-service
              servicePort: 8080
            path: /
  tls:
    - hosts:
        - developer1.mytestdomain.com
      secretName: mysslsecret
</code></pre>

<p>Then setup a wildcard domain on <code>*.mytestdomai.com</code>. So you don't have to add a subdomain each time and environment is built. Skip the <code>tls</code> part if you don't need <code>https</code>.</p>
