Cloud Run – 网络设置在不同版本之间不保留

huangapple go评论60阅读模式
英文:

Cloud Run - network settings not persisting between revisions

问题

我正在为我的Cloud Run服务添加一个VPC无服务器访问连接器。通常,我使用Cloud Code插件在VS Code中部署,并在本地使用Docker构建映像。每当我这样做时,我注意到我在GCP控制台中应用于先前版本的网络配置,即添加VPC访问连接器以及创建入口,都不会应用于任何新版本。

实际上,我注意到当我使用构建包而不是Docker进行部署时,网络设置似乎会从先前版本中“传递”,但会使用新的映像。

但我通常不使用构建包,所以我希望每次我部署新映像(首先在本地使用Docker构建)时,从先前版本继承网络配置。
这是一个bug吗?还是有一些设置可以将网络配置持久保存到后续版本?

第二张图片上写着我是“使用云控制台”部署的,因为我重新部署到控制台以设置网络设置到该版本,而第一张图片(最新版本)是使用Cloud Code VS插件部署的。

英文:

I am adding a VPC Serverless access connector to my cloud run service. I typically deploy with VS code using the cloud code plugin, and I build the image locally using Docker. Whenever I do this, I noticed that the network configuration I applied to a previous revision in the GCP console, namely, adding the VPC access connector, as well as creating an ingress, don't get applied to any new revision.

I actually noticed that when I deploy using buildpack instead of Docker, the network settings seem to "carry over" from the previous revision, but using the new image.

But I typically don't use buildpack, so I'd like that every time I deploy a new image (first building locally with docker) the network configuration from the previous revision carries over.
Is this a bug? Or is there some setting to persist network configurations to subsequent revisions?

Cloud Run – 网络设置在不同版本之间不保留

Cloud Run – 网络设置在不同版本之间不保留

Note on the second picture it says I deployed "using cloud console" because I redeployed on the console in order to set the network settings to that revision, where the first image (most recent revision) I deployed from cloud code vs plugin.

答案1

得分: 0

网络设置在使用构建包重新部署时保留的原因是因为Cloud Run抽象了构建和配置容器映像的复杂性。它确保在部署新容器时持久保存必要的设置,包括网络设置。

另一方面,当将Docker容器部署到Cloud Run时,您需要自己使用Dockerfile构建容器映像,包括网络设置和其他运行时要求的所有必要配置。

希望这有所帮助。

参考链接:

https://cloud.google.com/docs/buildpacks/overview
https://cloud.google.com/run/docs/deploying#console

英文:

The reason why network settings are retained when you redeploy using buildpack is because Cloud Run abstracts away the complexities of building and configuring the container image. It ensures that the necessary settings are persisted when the new container is deployed, including network settings.

On the other hand, when deploying a Docker container to Cloud Run, you need to build the container image yourself using the Dockerfile, including all the necessary configurations for network settings and other runtime requirements.

Hope this helps.

References:

https://cloud.google.com/docs/buildpacks/overview
https://cloud.google.com/run/docs/deploying#console

huangapple
  • 本文由 发表于 2023年6月15日 05:02:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/76477512.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定