<p>How to create an alb ingress such that only &quot;/&quot; will redirect to a service that shows static files in service-1. all other paths should redirect to service 2. it will host something like this</p>
<pre><code>spec:
  rules:
    - host: a.abc.com
      http:
        paths:
          - path: /
            backend:
              serviceName: service-1
              servicePort: 80
          - path: /v1
            backend:
              serviceName: service-2/v1
              servicePort: 9090
</code></pre>
<p>I know I can't have <code>service-2/v1</code> on <code>serviceName</code> but I want to map <code>/v1</code> to <code>service-2:9090/v1</code>.</p>
<p>I am hosting some static files in <code>service-1(nginx)</code> which I want to show on <code>/</code> and then <code>/v1</code> and <code>/admin</code> is on my another service (i.e <code>service-2/v1</code> and <code>service-2/admin</code>).</p>

Vikas Rathore
<p>Name of the service and any other resource may not contain <code>/</code> and <code>%</code> as explained <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#path-segment-names" rel="nofollow noreferrer">here</a> and if you would like to deploy it, it will show following error:</p>
<p><code>metadata.name: Invalid value: &quot;demo/v1&quot;: a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')</code></p>
<p>So you have to consider changing name of the services, besides that you can specify multiple paths in single <code>Ingress</code> definition:</p>
<pre><code>spec:
  rules:
    - host: a.abc.com
      http:
        paths:
          - path: /
            backend:
              serviceName: service-1
              servicePort: 80
          - path: /v1
            backend:
              serviceName: service-v1
              servicePort: 9090
          - path: /admin #additional path
            backend:
              serviceName: service-admin   #service name pointing to /admin
              servicePort: 9091    #port it will be accessible on
</code></pre>
