How to set up pod communication between 2 different Kubernetes Cluster

9/10/2019

I am working on a use case where I need to set up 2 Kubernetes Cluster ,and establish communication channel between 2 pods that are in separate GKE clusters. Please suggest a solution as how to implement the same.

-- Sushauvik Deb
kubernetes

2 Answers

9/10/2019

You can use these steps in kubernetes cluster

First cluster

1. Create deployment.
2.Expose Deployment using service type as NodePort.
3. Enable firewall rule for Port that is exposed by service.
4. List out node IP address.

Second cluster

1. Create deployment 
2. In deployment you can point endpoint of first cluster service 
as a environment vriables
        env:
        - name: SERVICE_URL
          value: xx.xx.xx.xx:xxxxx

Here xx.xx.xx.xx will be your clusters node IP and xxxx will be your cluster Node Port.

Like this your 1st cluster pod will communicate with 2nd cluster pod

-- Sachin Arote
Source: StackOverflow

9/10/2019

Consider using Istio.

Here is a detailed guide of how to:

configure a multicluster mesh with a single-network shared control plane topology over 2 Google Kubernetes Engine clusters.

This would allow inter-cluster direct pod-to-pod communication.

Please let me know if that helped.

-- OhHiMark
Source: StackOverflow