简体   繁体   English

如何在2个不同的Kubernetes集群之间建立Pod通信

[英]How to set up pod communication between 2 different Kubernetes Cluster

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. 我正在使用一个用例,其中我需要设置2个Kubernetes集群,并在单独GKE集群中的2个Pod之间建立通信通道。 Please suggest a solution as how to implement the same. 请提出一种解决方案,以实现相同的解决方案。

You can use these steps in kubernetes cluster 您可以在kubernetes集群中使用这些步骤

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. 这里xx.xx.xx.xx是您的群集节点IP,而xxxx是您的群集节点端口。

Like this your 1st cluster pod will communicate with 2nd cluster pod 这样,您的第一个集群Pod将与第二个集群Pod通信

Consider using Istio . 考虑使用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. 在2个Google Kubernetes Engine群集上配置具有单网络共享控制平面拓扑的多群集网格。

This would allow inter-cluster direct pod-to-pod communication. 这将允许群集之间直接进行Pod到Pod的通信。

Please let me know if that helped. 请让我知道是否有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM