简体   繁体   中英

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

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.

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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