简体   繁体   中英

How to access a Kubernetes Pod in Docker?

The setup below is all done on Google Cloud.

  • I have a Docker setup running on a VM instance having a Hyperledger Fabric Network of 3 Orderers and 2 peers of a single organization.

  • I have a Kubernetes Cluster running on GKE having just 2 peer pods.

What I want to achieve is:

I want the peer pod of Kubernetes to be able to communicate with the network setup in Docker. ie I want at least 1 peer of the Kubernetes to be able to join the network channel on the Docker Network and be able to perform some transaction/query.

Till now what I have done is exposed the services of the 2 peer pods in Kubernetes ie ClusterIP -> NodePort.

I have done some reading as to what options are there such as having an Nginx proxy and other things, but I am new to this and still in a beginner phase so a few things are still confusing to me.

Any help would be appreciated.

Since you have two separate container setups (and two different container technologies), containers in one space have to communicate with the other as though they're outside the cluster. You can't join arbitrary Docker containers on another instance into the Kubernetes network environment, nor can you join Kubernetes pods into a single-host Docker network environment.

Using a NodePort or LoadBalancer-type Service as you already have is close to the best you can do, particularly if the underlying protocol isn't HTTP. If you need a multi-host setup, migrating the whole thing into GKE might be a better long-term answer.

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