一直有在玩GCP,但工作上用不到所以其實都只是去console點一點而已。

最近心血來潮想多認識一下,所以就跑來裝gcloud

弱弱自己是用macOS,所以要先去macOS gcloud的頁面下載

解壓縮後直接執行./install.sh,這中間他會將.bashrc.zshrc新增路徑,讓使用者可以直接下gcloud的指令

    Welcome to the Google Cloud SDK!

    To help improve the quality of this product, we collect anonymized usage data
    and anonymized stacktraces when crashes are encountered; additional information
    is available at <https://cloud.google.com/sdk/usage-statistics>. This data is
    handled in accordance with our privacy policy
    <https://policies.google.com/privacy>. You may choose to opt in this
    collection now (by choosing 'Y' at the below prompt), or at any time in the
    future by running the following command:

    gcloud config set disable_usage_reporting false

    Do you want to help improve the Google Cloud SDK (y/N)?  y


    Your current Cloud SDK version is: 282.0.0
    The latest available version is: 282.0.0
    ┌──────────────────────────────────────────────────────────────────────────────────────    ──────────────────────┐
    │                                                 Components                                                 │
    ├───────────────┬──────────────────────────────────────────────────────┬───────────────    ───────────┬──────────┤
    │     Status    │                         Name                         │            ID            │   Size   │
    ├───────────────┼──────────────────────────────────────────────────────┼──────────────────────────┼──────────┤
    │ Not Installed │ App Engine Go Extensions                             │ app-engine-go            │  4.8 MiB │
    │ Not Installed │ Appctl                                               │ appctl                   │ 18.6 MiB │
    │ Not Installed │ Cloud Bigtable Command Line Tool                     │ cbt                      │  7.6 MiB │
    │ Not Installed │ Cloud Bigtable Emulator                              │ bigtable                 │  6.6 MiB │
    │ Not Installed │ Cloud Datalab Command Line Tool                      │ datalab                  │  < 1 MiB │
    │ Not Installed │ Cloud Datastore Emulator                             │ cloud-datastore-emulator │ 18.4 MiB │
    │ Not Installed │ Cloud Firestore Emulator                             │ cloud-firestore-emulator │ 40.2 MiB │
    │ Not Installed │ Cloud Pub/Sub Emulator                               │ pubsub-emulator          │ 34.9 MiB │
    │ Not Installed │ Cloud SQL Proxy                                      │ cloud_sql_proxy          │  3.7 MiB │
    │ Not Installed │ Emulator Reverse Proxy                               │ emulator-reverse-proxy   │ 14.5 MiB │
    │ Not Installed │ Google Cloud Build Local Builder                     │ cloud-build-local        │  5.9 MiB │
    │ Not Installed │ Google Container Registry's Docker credential helper │ docker-credential-gcr    │  1.8 MiB │
    │ Not Installed │ Kind                                                 │ kind                     │  4.4 MiB │
    │ Not Installed │ Minikube                                             │ minikube                 │ 20.3 MiB │
    │ Not Installed │ Skaffold                                             │ skaffold                 │ 12.8 MiB │
    │ Not Installed │ gcloud Alpha Commands                                │ alpha                    │  < 1 MiB │
    │ Not Installed │ gcloud Beta Commands                                 │ beta                     │  < 1 MiB │
    │ Not Installed │ gcloud app Java Extensions                           │ app-engine-java          │ 62.2 MiB │
    │ Not Installed │ gcloud app PHP Extensions                            │ app-engine-php           │ 21.9 MiB │
    │ Not Installed │ gcloud app Python Extensions                         │ app-engine-python        │  6.1 MiB │
    │ Not Installed │ gcloud app Python Extensions (Extra Libraries)       │ app-engine-python-extras │ 27.1 MiB │
    │ Not Installed │ kpt                                                  │ kpt                      │  9.8 MiB │
    │ Not Installed │ kubectl                                              │ kubectl                  │  < 1 MiB │
    │ Installed     │ BigQuery Command Line Tool                           │ bq                       │  < 1 MiB │
     84 #   export EDITOR='vim'
    │ Installed     │ Cloud SDK Core Libraries                             │ core                     │ 13.6 MiB │
    │ Installed     │ Cloud Storage Command Line Tool                      │ gsutil                   │  3.6 MiB │
    └───────────────┴──────────────────────────────────────────────────────┴───────────────    ───────────┴──────────┘
    To install or remove components at your current SDK version [282.0.0], run:
      $ gcloud components install COMPONENT_ID
      $ gcloud components remove COMPONENT_ID

    To update your SDK installation to the latest version [282.0.0], run:
      $ gcloud components update


    Modify profile to update your $PATH and enable shell command
    completion?

    Do you want to continue (Y/n)?  y

    The Google Cloud SDK installer will now prompt you to update an rc
    file to bring the Google Cloud CLIs into your environment.

    Enter a path to an rc file to update, or leave blank to use
    [/Users/yoyo/.zshrc]:
    Backing up [/Users/yoyo/.zshrc] to [/Users/yoyo/.zshrc.backup].
    [/Users/yoyo/.zshrc] has been updated.

    ==> Start a new shell for the changes to take effect.


    For more information on how to get started, please visit:
      https://cloud.google.com/sdk/docs/quickstarts

跑完之後,就下gcloud init去做初始化

中間出現的畫面跟需要認證的就不多說了,基本上照著走之後就會完成了。

之後有近一步研究再放上來。