GCP Windows配置SDK

创建配置

PS C:\Users\>gcloud config configurations create test-project

Created [test-project].

Activated [test-project].

 

切换到配置文件

PS C:\Users\> gcloud config configurations activate test-project

 

初始化配置

PS C:\Users\> gcloud init

Welcome! This command will take you through the configuration of gcloud.

 

Settings from your current configuration [test-project] are:

core:

  disable_usage_reporting: 'True'

 

Pick configuration to use:

 [1] Re-initialize this configuration [test-project] with new settings

 [2] Create a new configuration

 [3] Switch to and re-initialize existing configuration: [default]

 [4] Switch to and re-initialize existing configuration: [test-project]

 

这里选择1

Please enter your numeric choice:  1

 

Your current configuration has been set to: [test-project]

 

You can skip diagnostics next time by using the following flag:

  gcloud init --skip-diagnostics

 

Network diagnostic detects and fixes local network connection issues.

Checking network connection...done.

ERROR: Reachability Check failed.

    Cannot reach https://www.google.com (ServerNotFoundError)

    Cannot reach https://accounts.google.com (ServerNotFoundError)

    Cannot reach https://cloudresourcemanager.googleapis.com/v1beta1/projects (ServerNotFoundError)

    Cannot reach https://www.googleapis.com/auth/cloud-platform (ServerNotFoundError)

    Cannot reach https://dl.google.com/dl/cloudsdk/channels/rapid/components-2.json (ServerNotFoundError)

Network connection problems may be due to proxy or firewall settings.

 

如果需要代理选择Y,或者N

Do you have a network proxy you would like to set in gcloud (Y/n)?  y

 

Select the proxy type:

 [1] HTTP

 [2] HTTP_NO_TUNNEL

 [3] SOCKS4

 [4] SOCKS5

Please enter your numeric choice:  2

 

Enter the proxy host address: 你的代理地址

 

Enter the proxy port: 3128

 

Is your proxy authenticated (y/N)?  n

 

Cloud SDK proxy properties set.

 

Rechecking network connection...done.

ERROR: Reachability Check still does not pass.

    Cannot reach https://www.google.com (HTTPError)

 

Current effective Cloud SDK network proxy settings:

    type = http_no_tunnel

    host = test.com

    port = 3128

    username = None

    password = None

 

配置GCP环境

设置GCP的项目

PS C:\Users\>  gcloud config set test-project

设置GCP的地区

PS C:\Users\> gcloud config set compute/region asia-east2

Updated property [compute/region].

 

设置GCPzone

PS C:\Users\> gcloud config set compute/zone asia-east2-a

 

登陆你的GCP

PS C:\Users\> gcloud auth  test@test.com

 

4.查看配置文件

PS C:\Users\> gcloud config list

[compute]

region = asia-east2

zone = asia-east2-a

[core]

account =   test@test.com

disable_usage_reporting = True

project = test-project

[proxy]

address = test.com

port = 3128

type = http_no_tunnel

 

Your active configuration is: [test-project]

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值