[GCP]macOS安裝gcloud指令
@ GordonWei · Monday, Mar 2, 2020 · 3 minute read · Update at Mar 2, 2020

一直有在玩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去做初始化

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

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

GordonWei's blog

.net .net-framworke-3.5 4g-dongle 4g-lte 518 active-directory activity ad alcatel alpine always-free amd-apu ap apache arm associate aws aws-cdk aws-certified aws-cli aws-efs aws-lex aws-nuke aws-s3 aws-saa aws-security aws-ssm aws-sso aws帳單整合 bind bind-view blackbox blog brew bridge-network build-image calculator catalina centos centos-7 centos7 cfn-flip change-swap chatbot cidr cidrcalculator clean-cache clean-resources cloudfront command consolidated-billing controller cups curl deeplearning delete-sns developer directory-service dlink-dcs930l dns-server docker docker-build docker-compose docker-error docker-image docker-setting-proxy domain dotnet dvac01 ec2 ec2-mount-efs ec2-ssm elk error export-ovf exporter fail2ban fat32-to-ntfs freeradius funny gcloud gcp gcp-change-account git git-error github github-error google-adsens google-cloud-platform grafana grub hh41 homebridge homekit homekit-ui http https huawei-e3372 hugo hugo-blog hugo-post instances ios ios-run-python iphone-backup ipv6-apt iso-to-usb job-bank json json-dumps keras kibana kvm lambda latin ldap ldap3 letsencrypt libvirt likecoin linux linux-dotnet linux-vnc loop lte-dongle mac mac-backup mail-server mi-home migration mongodb monitor ms-ad multiple-account mysql mysql-error mysql-federated netapp npm npm-upgrade ns ntfs ntp-server oai on-premise openvpn openwebmail openwrt options oracle-cloud orange-pi organizations peering permission-deny pip-error pip-install port-25 printer prometheus proxy-server python python-access-ad python-ftp python2 python3 radius radius-mysql radius3.0 raspberry-pi raspberry-pi-zero rc.local request reset-password resize-img resize-sd-partition root router rpi-camera s3 s3-error s3-policy samba samba-error script scs-c01 security selinux session session-manage shell smtp sns solution-architect-associate ssh-server ssl ssl-error ssm sudo sysops system-manager systems-manager table-sync time-machine time_wait timezone tls totolink typeerror ubuntu ubuntu-18.04 ubuntu16.04 ubuntu20.04 unifi unifi-ac-lite uniout update-error usb usb-install virsh virt visudo vmware-player volume-lock vpc vpn vpn-server web-server wifi win-server win10 windows windows-server windows-server-2019 windows-ssh-server xiaomi yaml zimbra 廣告 永久免費 無法更新索引 無線分享器 燒光碟 自動搶 阿爾卡特
aws
gcp
iot
mac
oci

© 2021 GordonWei's Blog

Powered by Hugo with theme Dream.

Experience

2021 - Now / 博弘科技 - 資深SRE工程師

2020 - 2021 / 趣遊科技 - 資深SRE工程師

2019 - 2020 / 104人力銀行 - DevOps 工程師

2018 - 2019 / 104人力銀行 - Net 工程師

2016 - 2018 / 全林實業股份有限公司 - 系統部協理

2015 – 2016 / 恩據優資訊工作室 – 負責人

2014 – 2015 / 安盟科技股份有限公司 – 資深IT工程師

2013 – 2014 / 上海鷺豐農業科技有限公司 – 系統工程師

2010 – 2012 / 104 人力銀行 – 維護工程師

2008 - 2009 / 典匠資訊 – MIS

Projects

  • 2021/02 - 2021/12 博弘雲端 - 家樂福數位轉型
  • 2020/10 - 2020/11 趣遊科技 - 產品container化
  • 2020/09 - 2020/10 趣遊科技 - 產品架構重構
  • 2020/08 - 2020/09 趣遊科技 - 規範訂製
  • 2019/09 - 2020/07 104人力銀行 - AWS Account 回收暨IaC專案
  • 2018/10 - 2018/12 104人力銀行 - DR Site 協助建置
  • 2018/03 - 2018/05 全林實業 - 工研院人臉辨識與使用者行為分析專案
  • 2018/04 - 2018/05 全林實業 - 嘉義公車站無線網路專案
  • 2017/06 - 2018/05 全林實業 - 新加坡無線網路專案
  • 2017/05 - 2018/05 全林實業 - 捷運無線網路專案
  • 2017/01 - 2017/04 全林實業 - 弋楊科技遊覽車專案
  • 2016/12 - 2017/04 全林實業 - 亞太好行網重構、建置
  • 2016/12 - 2017/02 全林實業 - 愛巴士無線網路專案
  • 2016/11 - 2017/01 全林實業 - 泰國Free AD Wifi專案
  • 2016/10 - 2016/12 全林實業 - 桃園客運無線網路專案
  • 2016/09 - 2016/12 全林實業 - 怡客咖啡廳無線網路專案
  • 2016/07 - 2017/07 全林實業 - 主要系統規劃、重構與建置
  • 2014/09 - 2015/04 安盟科技 - 機房架構規劃rebuild / CRM系統開發客製
  • 2013/07 – 2014/07 上海鷺豐農業科技 - 研發農業環境監控系統(Arduino)
  • 2011/11 – 2012/06 104人力銀行 - 協助導入虛擬化技術專案 (Citrix Xen Server、Desktop)

About

GordonWei

小弟是一位沒錢又沒閒的普通人, 只能靠自學以及不斷的實作來吸取經驗。

希望可以把自己的經驗留存下來,讓彼此的能力更進一步!!

認證