che*_*rba 26 gcloud google-cloud-sdk gcloud-cli
有关Google Cloud SDK的文档https://cloud.google.com/sdk/docs/会gcloud init在安装后指示其运行.
有没有办法自动执行此步骤,因为这gcloud init是一个交互式命令?
che*_*rba 41
一个人不需要跑gcloud init.主要目标是确保配置凭据并且可能设置了项目属性.如果您拥有服务帐户凭据,则可以配置gcloud并准备好通过
gcloud auth activate-service-account --key-file=credential_key.json
gcloud config set project my-project
Run Code Online (Sandbox Code Playgroud)
为了完整性,gcloud init基本上执行以下步骤:
gcloud config configurations create my_configurationgcloud config configurations activate my_configurationgcloud auth logingcloud config set account my_existing_credentialsgcloud auth activate-service-accountgcloud config set project my_project
gcloud projects listgcloud config set compute/zone my_default_gce_zone
gcloud compute zones listgcloud config set compute/region my_default_gce_region
gcloud compute regions list| 归档时间: |
|
| 查看次数: |
6474 次 |
| 最近记录: |