简体   繁体   English

GCP,Cloud Run 外部 IP 不工作

[英]GCP, Cloud Run external IP is not working

I followed this https://cloud.google.com/run/docs/configuring/static-outbound-ip我跟着这个https://cloud.google.com/run/docs/configuring/static-outbound-ip

and it is not working它不工作

I can now check the static IP address on the VPC page and Cloud NAT page.我现在可以在VPC页面和Cloud NAT页面查看static IP地址。 (They both have the same address) (他们有相同的地址)

Why is that?这是为什么? I can still connect to the default address of Cloud Run https://readme-cloudshell-txt-... and the page appears normally.我仍然可以连接到Cloud Run的默认地址https://readme-cloudshell-txt-... 页面正常出现。

The static IP definition for Cloud Run (same for Cloud Functions) is only set for the outbound connection. Cloud Run 的 static IP 定义(与 Cloud Functions 相同)仅为出站连接设置。 That means only the communication initiated by the service to reach external endpoints (and you need to allowlist the requester IP on that external endpoint to allow access).这意味着只有服务发起的通信才能到达外部端点(并且您需要将该外部端点上的请求者 IP 列入白名单以允许访问)。

You can't reach your Cloud Run service on that IP, it's not dedicated to that.您无法通过该 IP 访问您的 Cloud Run 服务,它不专用于该服务。

However, if you want a static IP to reach Cloud Run, you can set a HTTPS load balancer in front of Cloud Run and, this time, you can define IPs on your Load Balancer to reach your serverless backends但是,如果您希望 static IP 到达 Cloud Run,您可以在 Cloud Run 前面设置一个 HTTPS 负载均衡器,这一次,您可以在负载均衡器上定义 IP 以访问您的无服务器后端

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

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