简体   繁体   中英

Google Cloud Run Internal DNS/IP for communication with same region VM

My app has two APIs - one hosted on Google Cloud Run, and the second on a VM instance. The general architecture is like this:

 ---------------        -----------------        ------------------
| Client Request| ---> | First API (VM)  | ---> | Second API (Run) |
 ---------------        -----------------        ------------------

When the VM sends a request to the second API, I want to use an internal IP/DNS in order to save networking egress costs. However, I can't find any documentations regarding how to do that. Maybe it's not possible, if so it's also find but I would just like to know.

Thank you very much!

For now, you can't call Cloud Run uniquely from the VPC. You have to use the public DNS of Cloud RUN

However, if your compute engine and your Cloud Run instance are in the same region, you won't pay egress traffic (traffic in the same region is free).

The Google internal router are smart enough to not route your traffic to internet for going back into the Google Network, and especially in the same region. In addition, and thanks to this smart routing, the latency will be very low.

Note: even if you use the project VPC and you have to call a Cloud Run in another region, you will pay egress (inter region traffic). Using internal IP/DNS only increase the security (not publicly accessible) but have no impact on the cost or the latency

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