Home > Blockchain >  How pods on different kubernates clusters can communicate?
How pods on different kubernates clusters can communicate?

Time:06-11

CASE 1: Suppose there is a pod running locally (running some workload/app )on a device1 and another pod running in EC2 instance running on AWS EKS instance . How can both of them communicate

CASE 2: Suppose there is a pod running locally (running some workload/app )on a device1 and another device 2 . How can both of them communicate ?

Pods can run locally using minikube or even directly using kubectl commands.

Problem :I know that pods within the same cluster can communicate with another Pod by directly addressing its IP address but how can pods on different clusters can communicate and what protocols they can use? .Please help me with this . enter image description here

CodePudding user response:

The pods can communicate with each other if they are exposed publicly via

  1. External IP e.g https://kubernetes.io/docs/tutorials/stateless-application/expose-external-ip-address/
  2. User Service to expose your pod publicly https://kubernetes.io/docs/tutorials/kubernetes-basics/expose/expose-intro/

If you require the pods to communicate using private ip using internal network, you can consider using VPC peering (connect all 3 networks that Device 1, Device 2 and Cloud/AWS VPC). This will require some networking knowledge to setup.

CodePudding user response:

You can expose the service publicly if you are looking for easy option and setup.

You can use the External IP (service type load balancer) or you can use the ingress controllers(nginx, kong, traefik) to expose the services.

For multi-cluster communication and service discovery you can use the service mesh like Istio and linkerD :
https://istio.io/latest/blog/2020/multi-cluster-mesh-automation/

LinkerD multicluster east-west setup: https://linkerd.io/2.11/features/multicluster/

  • Related