<p>I am trying to create an ingress resource as below, my issue is my service1 and service2 are  located in a different namespace in kubernetes. so in order my ingress resource to connect both the services I am providing as <code>service2.&lt;namespace&gt;</code>. but I am not able to create as (.) is not allowed. How can I point my service.2 present in a different namespace?</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: service1
            servicePort: 1000
        - path: "/test"
          backend:
            serviceName: service2.test
            servicePort: 2000
</code></pre>

magic
<p>You can solve it in two ways:</p>

<ul>
<li><p>You can create another <code>Ingress</code> resource in <code>test</code> namespace for the <code>/test</code> path. </p></li>
<li><p>If you are not running on GKE, you can also create a <code>Service</code> of type <code>ExternalName</code> in current namespace which maps to <code>service2</code> service in <code>test</code> namespace. Then you can use the name <code>service2</code> to refer to <code>service2.test</code></p></li>
</ul>

<pre><code>kind: Service
apiVersion: v1
metadata:
  name: service2
  namespace: default
spec:
  type: ExternalName
  externalName: service2.test.svc.cluster.local
  ports:
  - port: 2000
</code></pre>
