<p>We have two clusters. cluster1 has namespace- test1 and a service running as clusterip
we have to call that service from another cluster(cluster2) from namespace dev1.</p>
<p>I have defined externalname service in cluster2 pointing to another externalname service in cluster1.
And externalname service in cluster1 points to the original service running as clusterip.</p>
<p>In cluster2:</p>
<pre><code>kind: Service
apiVersion: v1
metadata:
  name: service
  namespace: dev1
  labels:
    app: service
spec:
  selector:
    app: service
  type: ExternalName
  sessionAffinity: None
  externalName: service2.test.svc.cluster.local
status:
  loadBalancer: {}
</code></pre>
<p>In cluster1:Externalname service</p>
<pre><code>kind: Service
apiVersion: v1
metadata:
  name: service2
  namespace: test1
  labels:
    app: service
spec:
  selector:
    app: service
  type: ExternalName
  sessionAffinity: None
  externalName: service1.test1.svc.cluster.local
status:
  loadBalancer: {}
</code></pre>
<p>in cluster1 clusterip service:</p>
<pre><code>kind: Service
apiVersion: v1
metadata:
  name: service1
  namespace: test1
  labels:
    app: service1
spec:
  ports:
    - name: http
      protocol: TCP
      port: 9099
      targetPort: 9099
  selector:
    app: service1
  clusterIP: 102.11.20.100
  type: ClusterIP
  sessionAffinity: None
status:
  loadBalancer: {}
</code></pre>
<p>But, there is no hit to the service in cluster1. I tried to add spec:port:9099 in externalname services as well, still it does not work.</p>
<p>What could be the reason. Nothing specific in logs too</p>

<p>This is not what <code>ExternalName</code> services are for.</p>
<p><code>ExternalName</code> services are used to have a cluster internal service name that forwards traffic to another (internal or external) DNS name. In practice what an <code>ExternalName</code> does is create a CNAME record that maps the external DNS name to a cluster-local name. It does not expose anything out of your cluster. See <a href="https://kubernetes.io/docs/concepts/services-networking/service/#externalname" rel="nofollow noreferrer">documenation</a>.</p>
<p>What you need to do is expose your services outside of your kubernetes clusters and they will become usable from the other cluster as well.</p>
<p>There are different ways of doing this.
For example:</p>
<ul>
<li><a href="https://kubernetes.io/docs/concepts/services-networking/service/#nodeport" rel="nofollow noreferrer"><code>NodePort service</code></a>: when using a NodePort, your service will be exposed on each node in the cluster on a random high port (by default in the 30000-32767 range). If your firewall allows traffic to such port you could reach your service from using that port.</li>
<li><a href="https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer" rel="nofollow noreferrer"><code>LoadBalancer service</code></a>: if you are running kubernetes in an environment that supports Load Balancer allocation you could expose your service to the internet using a load balancer.</li>
<li><a href="https://kubernetes.io/docs/concepts/services-networking/ingress/" rel="nofollow noreferrer"><code>Ingress</code></a>: if you have an ingress controller running in your cluster you could expose your workload using an <code>Ingress</code>.</li>
</ul>
<p>On the other cluster, you could simply reach the service exposed.</p>
