<p>I've 3 angular applications that are deployed on Kubernetes. I'm trying to run all 3 with just one hostname and different paths. Here is my ingress.</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/rewrite-target: /$1
  name: test-ingress-deployment
  namespace: my-namespace
spec:
  tls:
  - hosts:
    - dns-name.eastus.cloudapp.azure.com
    secretName: aks-ingress-tls
  rules:
  - host: dns-name.eastus.cloudapp.azure.com
    http:
      paths:
      - backend:
          serviceName: ui-svc
          servicePort: 80
        path: /(.*)
      - backend:
          serviceName: ui-svc-one
          servicePort: 80
        path: /one/?(.*)
      - backend:
          serviceName: ui-svc-two
          servicePort: 80
        path: /two/?(.*)
</code></pre>

<p>All these 3 services are in different namespaces. I'm getting 503 for every endpoint I'm trying to hit, after applying ingress.</p>

<p>Documentation around this is scarce, at least I wasn't able to find something except for Github issues shedding a little light into this issue. But as far as I know cross namespace access was intentionally avoided in K8s, it would be a prime source of privilege escalation attacks.</p>

<p>To my knowledge you do have two options:</p>

<ol>
<li>You can run your ingress and ingress controller inside the <code>kube-system</code> namespace. But this is not recommended as <code>kube-system</code> is meant for K8s components only and it most likely creates security concerns.</li>
<li>You can have the ingress in the namespace your service resides in. But then you need an ingress controller which allows merging of rules which not all support afaik.</li>
</ol>

<p>There are probably more solutions out there, maybe someone with more in-depth K8s knowledge can shed more light on it.</p>
