<p>I have a simple ingress network, I want to access services at different namespaces, from this ingress network.</p>

<p>How I can do this? 
My ingress network yaml file: </p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: ingress
spec:
  rules:
 - host: api.myhost.com
 http:
 paths:
  - backend:
      serviceName: bookapi-2
      servicePort: 8080
    path: /booking-service/
</code></pre>

<p>I've set the ExternalNames service type to the yaml file: </p>

<pre><code> apiVersion: v1
 kind: Service
 metadata:
   name: bookapi-2
   namespace: booking-namespace
 spec:
   type: ExternalName
   externalName: bookapi-2
   ports:
     - name: app
     protocol: TCP
      port: 8080
      targetPort: 8080
   selector:
      app: bookapi-2
      tier: backend-2
</code></pre>

<blockquote>
  <p>An ExternalName service is a special case of service that does not
  have selectors and uses DNS names instead.</p>
</blockquote>

<p>You can find out more about ExternalName service from the official <a href="https://kubernetes.io/docs/concepts/services-networking/service/#externalname" rel="noreferrer">Kubernetes documentation</a>:</p>

<p>When  you want to access a service from a different namespace, your yaml could, for <a href="https://akomljen.com/kubernetes-tips-part-1/" rel="noreferrer">example</a>, look like this:</p>

<pre><code>kind: Service
apiVersion: v1
metadata:
  name: test-service-1
  namespace: namespace-a
spec:
  type: ExternalName
  externalName: test-service-2.namespace-b.svc.cluster.local
  ports:
  - port: 80
</code></pre>

<p>As to your Ingress yaml file, please recheck it and make sure it is compliant with the official examples, for <a href="https://medium.com/@cashisclay/kubernetes-ingress-82aa960f658e" rel="noreferrer">example</a> this one as it contains some inconsistency:</p>

<pre><code>apiVersion: extensions/v1beta1  
kind: Ingress  
metadata:  
  name: my-ingress  
spec:  
  rules:  
  - host: www.mysite.com  
    http:  
      paths:  
      - backend:  
          serviceName: website  
          servicePort: 80  
  - host: forums.mysite.com  
    http:  
      paths:  
      - path:  
        backend:  
          serviceName: forums  
          servicePort: 80
</code></pre>

<p>Please also recheck ExternalName yaml as it has TargetPorts and selectors which are not used in this type of <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="noreferrer">Service</a> and make sure that:</p>

<blockquote>
  <p>ExternalName Services are available only with <code>kube-dns</code> version 1.7
  and later.</p>
</blockquote>

<p>In case you will not succeed, please share the kind of problem you have meet.  </p>
