<p>I have 3 services in my ingress, the first 2 use <code>default</code> namespace. The third service is <strong>prometheus-server</strong> service which has namespace <code>ingress-nginx</code>.
Now, I want to map my prometheus DNS to the service, but getting error because ingress can't find the prometheus service in <code>default</code> namespace.</p>

<p>How to deal with non-default namespace in ingress definition?</p>

Justinus Hermawan
<p>You would want to create a new <code>Ingress</code> in namespace <code>ingress-nginx</code> that would route your DNS to that service. For example:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: example
  namespace: ingress-nginx
spec:
  rules:  
  - host: your.domain.com
    http:
      paths:
      - path: /
        backend:
          serviceName: prometheus-server
          servicePort: 80
</code></pre>
