使用GCPAPI网关通过私有入口将CloudRun后端前置

我想在我的 Cloud Run 托管 API 前面使用 API 网关,并且只允许从 API 网关访问 Cloud Run URL。

我目前有一个 API 部署到 Cloud Run,并启用了“公共”入口和授权。这有效,但是我很好奇是否可以将 Cloud Run 上的入口模型更改为“内部”,以完全避免将任何互联网流量路由到我的 Cloud Run 容器。

我知道 API Gateway 处于 Beta 版,内部入口的某些方面似乎也是 Beta 版——但是我很好奇是否有办法使这项工作发挥作用。

根据入口文档,似乎如果我能以某种方式使我的 API 网关请求来自 VPC 网络,则此设置应该可以工作,但是我无法找到在 API 网关端实现此目的的方法。

回答

当您部署仅具有内部入口的 Cloud Run 服务时,请求需要来自 VPC SC 或来自您的 VPC。

使用 API Gateway,您无法插入 VPC 或使用VPC SC 中的服务(不支持的服务),因此您还不能。

团队已经意识到这个问题,应该努力解决这个问题。我不知道优先级和预计到达时间。

  • For API Gateway, it's not suitable to not be connected to VPC. You are talking about Cloud Run private ingress, but the issue is the same with VM without public IP and with internal load balancer. The update will come, I don't know when, but it's mandatory for this product!
  • I recommend you to use public resources with the correct authorization to protect your Cloud Run. If you add an additional layer like a Load Balancer, it will be more expensive, it will take time to set up and to remove when the feature will be released.

以上是使用GCPAPI网关通过私有入口将CloudRun后端前置的全部内容。
THE END
分享
二维码
< <上一篇
下一篇>>