在Cloud Run API中,您应该在部署服务时设置环境变量。

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

Where do you pass Environment variable in Cloud Run API

问题

在云运行中,您可以像以下方式传递环境变量:

如何在云运行API中传递这些变量?

https://cloud.google.com/run/docs/reference/rest/v2/projects.locations.services

英文:

In the cloud run you can pass environment variables like following

在Cloud Run API中,您应该在部署服务时设置环境变量。

how do i pass these in the cloud run API?

https://cloud.google.com/run/docs/reference/rest/v2/projects.locations.services

答案1

得分: 2

如果您熟悉Kubernetes,您必须注意环境变量与在Pod中运行的容器相关联。

对于Cloud Run,情况相同。通过API,您部署一个修订版。所以,请访问RevisionTemplate,然后到container(这是一个列表,现在只有一个是可能的,但在不久的将来将接受多个容器)。

从容器中,您可以查看"env"对象,该对象允许您引用您的环境变量。

英文:

If you are familiar with Kubernetes, you have to notice the environment variable are corelated with the container run in the Pod.

With Cloud Run, it's the same. With the API, you deploy a revision. So, go to the RevisionTemplate, then to the container (it's a list, only one is possible now, but several containers will be accepted in a near future).

From the container, you can see the "env" object that allows you to reference your env vars.

huangapple
  • 本文由 发表于 2023年2月23日 21:17:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/75545375.html
匿名

发表评论

匿名网友

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

确定