设置默认的云运行区域? (GCP)

发布于 2025-01-24 12:50:11 字数 1001 浏览 0 评论 0 原文

每当运行云运行服务 云外壳

gcloud run deploy myapp --image gcr.io/myproject-1831713/myapp

我总是被要求输入云运行区域,如下所示:

请指定一个区域:
[1] Asia-East1
[2] Asia-East2
[3]亚洲 - 东北1 [4]亚洲 - 东北2
[5]亚洲 - 东北3
[6]亚洲 - 南1
[7]亚洲 - 南2
[8]亚洲 - 东南1
[9]亚洲 - 东南2
[10]澳大利亚 - 东南1
[11]澳大利亚 - 东南2
[12]欧洲 - 中心2 [13]欧洲 - 北1
[14]欧洲 - 西1
[15]欧洲 - 西2
[16]欧洲 - 西3
[17]欧洲 - 西4
[18]欧洲 - 欧洲6
[19] Northamerica-Northeast1
[20] Northamerica-Northeast2
[21] Southamerica-East1
[22] Southamerica-West1
[23] us-Central1
[24] us-east1
[25] us-east4
[26] us-west1
[27] us-west2
[28] us-west3 [29] us-west4
[30]取消 请输入您的数字选择:

这样我就不要求输入云行驶区域每当运行 on cloud> cloud shell ,是否可以设置默认的云运行区域?如果可能,我该怎么做?

Whenever running a Cloud Run service on Cloud Shell:

gcloud run deploy myapp --image gcr.io/myproject-1831713/myapp

I'm always asked to input a Cloud Run region as shown below:

Please specify a region:
[1] asia-east1
[2] asia-east2
[3] asia-northeast1
[4] asia-northeast2
[5] asia-northeast3
[6] asia-south1
[7] asia-south2
[8] asia-southeast1
[9] asia-southeast2
[10] australia-southeast1
[11] australia-southeast2
[12] europe-central2
[13] europe-north1
[14] europe-west1
[15] europe-west2
[16] europe-west3
[17] europe-west4
[18] europe-west6
[19] northamerica-northeast1
[20] northamerica-northeast2
[21] southamerica-east1
[22] southamerica-west1
[23] us-central1
[24] us-east1
[25] us-east4
[26] us-west1
[27] us-west2
[28] us-west3
[29] us-west4
[30] cancel
Please enter your numeric choice:

So that I'm not asked to input a Cloud Run region whenever running a Cloud Run service on Cloud Shell, is it possible to set a default Cloud Run region? If possible, how can I do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我偏爱纯白色 2025-01-31 12:50:11

是的,可以在下面的以下命令中设置 ,以便您不要求输入云运行区域每当运行云运行服务 on cloud shell

gcloud config set run/region <region>

因此,例如,在下面运行此命令默认的云运行区域“ Asia-Northeast1”

gcloud config set run/region asia-northeast1

此外,您可以在下面的以下命令中检查您的默认云运行区域

gcloud config get run/region

然后,这就是结果:

您的活动配置是:[Cloudshell-5343]
亚洲 - 东北1

,您可以检查所有配置,包括您的默认云运行区域,其中以下命令:

gcloud config list

然后,这就是结果:

[可访问性]
screen_reader = true
[component_manager]
disable_update_check = true
[计算]
gce_metadata_read_timeout_sec = 30
[core]
account =
项目= myproject-383171
[指标]
环境= Devshell
[运行]
区域=亚洲 - 东北1

您的活动配置为:[Cloudshell-5343]

此外,您可以在下面的命令中解开默认

gcloud config unset run/region

您的默认云运行区域

gcloud config get run/region

那么,这就是结果:

您的活动配置是:[Cloudshell-5343]
(未设置)

Yes, it's possible to set a default Cloud Run region with this command below so that you're not asked to input a Cloud Run region whenever running a Cloud Run service on Cloud Shell:

gcloud config set run/region <region>

So, for example, run this command below to set the default Cloud Run region "asia-northeast1" :

gcloud config set run/region asia-northeast1

In addition, you can check your default Cloud Run region with this command below:

gcloud config get run/region

Then, this is the result:

Your active configuration is: [cloudshell-5343]
asia-northeast1

And, you can check all configurations including your default Cloud Run region with this command below:

gcloud config list

Then, this is the result:

[accessibility]
screen_reader = True
[component_manager]
disable_update_check = True
[compute]
gce_metadata_read_timeout_sec = 30
[core]
account = [email protected]
disable_usage_reporting = True
project = myproject-383171
[metrics]
environment = devshell
[run]
region = asia-northeast1

Your active configuration is: [cloudshell-5343]

In addition again, you can unset your default Cloud Run region with this command below:

gcloud config unset run/region

Then, check your default Cloud Run region:

gcloud config get run/region

Then, this is the result:

Your active configuration is: [cloudshell-5343]
(unset)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文