# Ingress Controller Ignores Namespace for the ingress

**URL:** <https://discuss.konghq.com/t/ingress-controller-ignores-namespace-for-the-ingress/3428>\
**Category:** Questions\
**Tags:** kubernetes\
**Created:** [May 1, 2019, 7:29pm UTC](https://discuss.konghq.com/t/ingress-controller-ignores-namespace-for-the-ingress/3428 "2019-05-01T19:29:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gauravh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/gauravh/32/294_2.png) [@gauravh](https://discuss.konghq.com/u/gauravh)\
**Post date:** [May 1, 2019, 7:29pm UTC](https://discuss.konghq.com/t/ingress-controller-ignores-namespace-for-the-ingress/3428/1 "2019-05-01T19:29:36Z")

</div>

I’ve currently deployed the all-in-one postgres setup. I am basically trying to use a single kong ingress controller with 2 different environments dev/stage in their own namespaces.

> * * *
> 
> ## apiVersion: extensions/v1beta1 kind: Deployment metadata: name: dashboard namespace: demo spec: template: metadata: labels: name: dashboard app: dashboard spec: containers: - name: dashboard image: dc-dashboard:latest ports: - name: web containerPort: 8080 protocol: TCP
> 
> ## apiVersion: v1 kind: Service metadata: name: dashboard-service namespace: demo spec: selector: app: dashboard ports: - name: dashboard-web port: 80 targetPort: 8080 protocol: TCP
> 
> apiVersion: extensions/v1beta1  
> kind: Ingress  
> metadata:  
> name: dashboard-ingress  
> namespace:demo  
> annotations:  
> [kubernetes.io/ingress.class:](http://kubernetes.io/ingress.class:) “kong”  
> spec:  
> rules:  
> - host: k8.domain.cloud  
> http:  
> paths:  
> - path: /dashboard  
> backend:  
> serviceName: dashboard-service  
> servicePort: 80

The following setup works if i deploy everything under the default namespace, however, if it’s deployed in the `demo` namespace then the kong ingress controller the following errors

```
W0501 19:23:30.587411 6 queue.go:113] requeuing kong/kong-proxy, err error building kong state: building upstreams and targets: error getting endpoints for 'default/dashboard-service' service: error getting service 'default/dashboard-service' from the cache: service default/dashboard-service was not found
W0501 19:23:33.920767 6 queue.go:113] requeuing default/nginx, err error building kong state: building upstreams and targets: error getting endpoints for 'default/dashboard-service' service: error getting service 'default/dashboard-service' from the cache: service default/dashboard-service was not found

```

---

<div class="post-metadata">

**Author:** ![hbagdi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/hbagdi/32/562_2.png) [@hbagdi](https://discuss.konghq.com/u/hbagdi)\
**Post date:** [May 2, 2019, 3:49am UTC](https://discuss.konghq.com/t/ingress-controller-ignores-namespace-for-the-ingress/3428/2 "2019-05-02T03:49:26Z")

</div>

Have you ensured that the service actually exists in the `demo` namespace?

Also, it might happen that you create the Ingress resource first and the Ingress Controller complains about it and once your service is actually created, it won’t complain anymore.

Hope that helps!
