简体   繁体   English

在不使用k8s服务的情况下将Pod从一个群集连接到另一个群集中的Pod

[英]Connect Pods from one cluster to a pod in aother cluster without using k8s service

We have two k8s clusters: 我们有两个k8s集群:

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 假设每个群集中有3个Pod

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 . 如何使用k8s IP或hostnamecluster1访问cluster2cluster2的应用程序而不创建k8s服务。 Any solution available to publish/advertise pods IP/hostname from one cluster to another? 有什么解决方案可以将Pod IP/hostname从一个群集发布/广告到另一个群集? If creating a service is mandatory, any options to achieve it without Type: LoadBlanacer or Ingress? 如果必须创建服务,那么没有类型的任何选项都可以实现:LoadBlanacer或Ingress?

Appreciate any inputs. 感谢任何输入。

Are you sure you are not confusing nodes with clusters? 您确定不会将节点与群集混淆吗? Because if these pods exist on different nodes, within the same cluster, then you can simply access the pod with its IP. 因为如果这些Pod存在于同一群集中的不同节点上,那么您可以简单地使用其IP访问Pod。

Otherwise, it is not possible to connect to your pod outside the cluster without making your pod public by a service(NodePort, LoadBalancer) or Ingress. 否则,如果不通过服务(NodePort,LoadBalancer)或Ingress将Pod公开,则无法连接到集群外部的Pod。

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

相关问题 从运行在不同 k8s 集群中的 pod 启动不同 k8s 集群中的 pod - Launching a pod in a different k8s cluster from a pod running in a different k8s cluster 如何使用同一 k8s 集群中的 kubectl exec 从另一个 pod 中的一个 pod 执行命令 - How to execute command from one pod inside another pod using kubectl exec which are inside a same k8s cluster 重启集群中的所有 k8s pod? - Restart all k8s pods in cluster? 使用yaml在K8s中不同集群中的Pod之间进行通信 - Communication Between Pods in Different Cluster in K8s using yaml k8s 集群 pod 终止进程 - k8s cluster pod terminates process 使用没有 minikube 的 docker 文件的 k8s 集群中的部署问题,但我的 pod 没有运行 - Deployment issue in k8s cluster using docker file without minikube, but my is pod not running 如何使用k8s-java-client在同一k8s集群上的同一服务的pod之间进行通信? - How to communicate between pods of the same service on the same k8s cluster using k8s-java-client? Redis如何在K8s集群的NodeJS中连接服务? - How to connect Redis with service in NodeJS in K8s cluster? 如何将 pod(基于 pod 名称)安装到 K8s 集群中的特定节点? - How to install pods (based on pod name) to specific nodes in K8s cluster? 如何配置k8s客户端,以便它可以与k8s集群Pod中的k8s CRD对话? - How to config k8s client so that it can talk to k8s CRDs from a k8s cluster pod?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM