<p>I have a problem with ingress, where I have multiple environments in my single kubernetes clustering... Now the problem is that if I have a single environment it works perfectly fine with below configuration, As soon as I deploy second envioronment and hit the ip of second environment, it is started pointing to first environment  even though service names are different</p>

<p>my first ingress</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: test-ingress
  namespace: default
  annotations:
    kubernetes.io/ingress.class: "nginx"
    nginx.ingress.kubernetes.io/ssl-redirect: "false"
    nginx.ingress.kubernetes.io/use-regex: "true"
    nginx.ingress.kubernetes.io/add-base-url: "true"
spec:
  rules:
  - host: test.com
    http:
      paths:
        - path: "/"
          backend:
            serviceName: servicetest-1
            servicePort: 1000
        - path: "/test"
          backend:
            serviceName: servicetest-1
            servicePort: 2000
</code></pre>

<p>my second ingress-resources:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: test-ingress
  namespace: default
  annotations:
    kubernetes.io/ingress.class: "nginx"
    nginx.ingress.kubernetes.io/ssl-redirect: "false"
    nginx.ingress.kubernetes.io/use-regex: "true"
    nginx.ingress.kubernetes.io/add-base-url: "true"
spec:
  rules:
  - host: test.com
    http:
      paths:
        - path: "/"
          backend:
            serviceName: servicetest-2
            servicePort: 1000
        - path: "/test"
          backend:
            serviceName: servicetest-2
            servicePort: 2000
</code></pre>

<p>The catch is if I delete my ingress resources in first environment, second environment starts working fine.</p>

<p>Another point both of my ingress resources are deployed in the same namespace</p>

<p>is that something I need to do in annotations or re-directions</p>

<p>Any help is appreciated</p>

magic
<p>Both <code>Ingress</code> have the same <code>name</code> and are in the same <code>namespace</code>. As the only difference between both ingress are <code>spec.rules.http.paths.backend.serviceName</code> and Name and Namespace stayed the same, Kubernetes overwritte previous config instead of create new resource.</p>

<p><code>ingress.extensions/test-ingress configured</code></p>

<p>You should change name of <code>ingress</code> resource.</p>
