<p>I have 2 namespaces called <code>dev</code> and <code>stage</code>
in both namespaces I have similar setups. In both namespaces I have service called frontend.</p>

<p>I wanted to set up an ingress for this. I set up ingress in both namespaces with the following config: </p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: my-ingress
spec:
  rules:
  - host: dev.myapp.io
    http:
      paths:
      - backend:
          serviceName: frontend
          servicePort: 80
</code></pre>

<p>In the stage just changed the host to <code>stage.myapp.io</code>. It is not working for one of the namespaces. 
Does my approach is correct? Or I need to set up ingress in another namepace (Kube-system maybe) and point paths in the same ingress? </p>

<p>PS: If I change service names and keep it different, 2 ingress works just fine but I want to set up services with same namespace, as it simplifies my other deployments.</p>

Guru
<p>Your are supposed to include the namespace annotation to your Ingress. Considering it, your yaml files should look like this: </p>

<p>Dev:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: my-ingress-dev
  namespace: dev
spec:
  rules:
  - host: dev.myapp.io
    http:
      paths:
      - backend:
          serviceName: frontend
          servicePort: 80    
</code></pre>

<p>Stage:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: my-ingress-stage
  namespace: stage
spec:
  rules:
  - host: stage.myapp.io
    http:
      paths:
      - backend:
          serviceName: frontend
          servicePort: 80   
</code></pre>
