简体   繁体   中英

Kubernetes pod to GCP Compute Engine VM communication

How can I connect to VM's running in GCP compute engine from Kubernetes pod? I have setup a proxy server in Compute Engine and I need to use that from within pods.

This communication needs to be using internal IP. I have allowed firewall rules to allow all internal IP.

Any suggestions on how to connect from pods to gcp vm's?

You can create an internal load balancer in GCP and connect VM or you can use the VPC peering if in a different network.

  • If your GKE and VM are in the same network you can use the internal IP of your VM to connect with.

From inside of POD you can send curl requests to the VM over internal IP.

OR

  • If your GKE and GCP VM both are in the different networks you can use the VPC peering to connect both networks and use the internal IP of VM from POD.

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