# Connect Pods from one cluster to a pod in aother cluster without using k8s service

**URL:** <https://discuss.kubernetes.io/t/connect-pods-from-one-cluster-to-a-pod-in-aother-cluster-without-using-k8s-service/8801>\
**Category:** General Discussions\
**Created:** [November 25, 2019, 7:09am UTC](https://discuss.kubernetes.io/t/connect-pods-from-one-cluster-to-a-pod-in-aother-cluster-without-using-k8s-service/8801 "2019-11-25T07:09:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rm75](https://avatars.discourse-cdn.com/v4/letter/r/57b2e6/32.png) [@rm75](https://discuss.kubernetes.io/u/rm75)\
**Post date:** [November 25, 2019, 7:09am UTC](https://discuss.kubernetes.io/t/connect-pods-from-one-cluster-to-a-pod-in-aother-cluster-without-using-k8s-service/8801/1 "2019-11-25T07:09:10Z")

</div>

We have two k8s clusters:

Cluster details:

Cluster 1: Pod Network: 172.16.1.0/24 Node Network: 172.16.2.0/24

Cluster 2: Pod Network: 172.16.3.0/24 Node Network: 172.16.4.0/24

All these networks are connectivity to one another.

Suppose we have 3 pods in each clusters

Cluster1-Pod1: IP: 172.16.1.1 Cluster1-Pod2: IP: 172.16.1.2 Cluster1-Pod3: IP: 172.16.1.3

Cluster2-Pod1: IP: 172.16.3.1 Cluster2-Pod2: IP: 172.16.3.2 Cluster2-Pod3: IP: 172.16.3.3

How can one access the apps of pods in cluster2 from cluster1 without creating a k8s service using Pod IP or hostname. Any solution available to publish/advertise pods IP/hostname from one cluster to another? If creating a service is mandatory, any options to achieve it without Type: LoadBlanacer or Ingress?

Appreciate any inputs.

Kubernetes version: 1.16  
Cloud being used: (put bare-metal if not on a public cloud) PKS  
Installation method: PKS  
Host OS: Ubuntu  
CNI and version: NSXT  
CRI and version:

You can format your yaml by highlighting it and pressing Ctrl-Shift-C, it will make your output easier to read.

---

<div class="post-metadata">

**Author:** ![thockin](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/thockin/32/2457_2.png) [@thockin](https://discuss.kubernetes.io/u/thockin)\
**Post date:** [November 25, 2019, 4:28pm UTC](https://discuss.kubernetes.io/t/connect-pods-from-one-cluster-to-a-pod-in-aother-cluster-without-using-k8s-service/8801/2 "2019-11-25T16:28:03Z")

</div>

If the IP spaces are disjoint (they seem to be) then you “just” need to establish routes for each range to the correct nodes. That could be as simple as proxy ARP in an L2 domain, or static routes in higher-level network setups. For example, maybe BGP can be used between nodes or some other way of propagating the routes.

---

<div class="post-metadata">

**Author:** ![rm75](https://avatars.discourse-cdn.com/v4/letter/r/57b2e6/32.png) [@rm75](https://discuss.kubernetes.io/u/rm75)\
**Post date:** [November 25, 2019, 5:28pm UTC](https://discuss.kubernetes.io/t/connect-pods-from-one-cluster-to-a-pod-in-aother-cluster-without-using-k8s-service/8801/3 "2019-11-25T17:28:44Z")

</div>

Thanks for your quick response.

Networks have connectivity between them. For example, I can ping Cluster 2 Pod1 from Cluster 1 Pod1.  
However we have to manually enter the IPs in our application to access a pod in another cluster.

I am looking for a solution similar to external-DNS([https://github.com/kubernetes-sigs/external-dns](https://github.com/kubernetes-sigs/external-dns)) to publish endpoints.

---

<div class="post-metadata">

**Author:** ![thockin](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/thockin/32/2457_2.png) [@thockin](https://discuss.kubernetes.io/u/thockin)\
**Post date:** [November 25, 2019, 6:53pm UTC](https://discuss.kubernetes.io/t/connect-pods-from-one-cluster-to-a-pod-in-aother-cluster-without-using-k8s-service/8801/4 "2019-11-25T18:53:14Z")

</div>

Ahh. I see.

There are some solutions out there but they tend to be very cloud-centric. As a community, I think we need to make this problem easier. Unfortunately, I do not have a canned answer for you yet.
