<p>Kubernetes <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset" rel="nofollow noreferrer">StatefulSets</a> create internal DNS entries with stable network IDs. The docs describe this here:</p>

<blockquote>
  <p>Each Pod in a StatefulSet derives its hostname from the name of the
  StatefulSet and the ordinal of the Pod. The pattern for the
  constructed hostname is $(statefulset name)-$(ordinal). The example
  above will create three Pods named web-0,web-1,web-2. A StatefulSet
  can use a Headless Service to control the domain of its Pods. The
  domain managed by this Service takes the form: $(service
  name).$(namespace).svc.cluster.local, where “cluster.local” is the
  cluster domain. As each Pod is created, it gets a matching DNS
  subdomain, taking the form: $(podname).$(governing service domain),
  where the governing service is defined by the serviceName field on the
  StatefulSet.</p>
</blockquote>

<p>I am experimenting with headless services, and this works great for communication between individual services i.e <code>web-0.web.default.svc.cluster.local</code> can connect and communicate with <code>web-1.web.default.svc.cluster.local</code> just fine.</p>

<p><strong>Is there any way that I can configure this to work outside of the cluster network as well, where "cluster.local" is replaced with something like "clustera.com"?</strong></p>

<p>I would like to give another kubernetes cluster, lets call it clusterb.com, access to the individual services of the original cluster (clustera.com); I'm hoping it would look something like clusterb simply hitting endpoints like <code>web-1.web.default.svc.clustera.com</code> and <code>web-0.web.default.svc.clustera.com</code>.</p>

<p>Is this possible? I would like access to the individual services, not a load balanced endpoint.</p>

<p>I would suggest you to test the following solutions and check if they can help you to achieve your goal in your particular scenario:</p>

<ul>
<li><p>The first one is for sure the easiest and I believe that you didn't implemented it for some reason and you did not reported in the question why.</p>

<p>I am talking about <a href="https://kubernetes.io/docs/concepts/services-networking/service/#headless-services" rel="nofollow noreferrer">Headless services</a> Without selectors CNAME records for ExternalName-type services. </p>

<blockquote>
  <p><a href="https://akomljen.com/kubernetes-tips-part-1/" rel="nofollow noreferrer">ExternalName</a>: Maps the service to the contents of the externalName field (e.g. foo.bar.example.com), by returning a CNAME record with its value. No proxying of any kind is set up. This requires version 1.7 or higher of kube-dns</p>
</blockquote>

<p>Therefore if you need to point a service of an other cluster you will need to register a domain name pointing to the relative IP of <code>clusterb</code>.</p></li>
<li><p>The second solution that I have never tested, but I believe it can apply to your case is to make use of a <a href="https://kubernetes.io/docs/concepts/cluster-administration/federation/" rel="nofollow noreferrer">Federated Cluster</a> whose reason why to use it is accordinding to the documentation:</p>

<blockquote>
  <p>Cross cluster discovery: Federation provides the ability to auto-configure DNS servers and load balancers with backends from all clusters. For example, you can ensure that a global VIP or DNS record can be used to access backends from multiple clusters. </p>
</blockquote></li>
</ul>
