gcloud command cheatsheet

基本的なところだけ。 こういうの devhints とか建てて書いといたほうがいいんだろうなぁ…

auth

# ログイン
$ gcloud auth login
# リスト
$ gcloud auth list

config

# リスト
$ gcloud config list
# アカウント変更
$ gcloud config set account <ACCOUNT>

project

# リスト
$ gcloud projects list
# 変更
$ gcloud config set project <PROJECT_ID>

compute

# リージョンリスト
$ gcloud compute regions list
# リージョン変更
$ gcloud config set compute/region <REGION>  # asia-northeast1
# リージョンリスト
$ gcloud compute zones list
# リージョン変更
$ gcloud config set compute/zone <REGION>  # asia-northeast1

components

$ gcloud components update  # アップデート
$ gcloud components install <COMPONENT> # インストール。kubectlとか。
$ gcloud components list  # リスト

address

# グローバルIP作成
$ gcloud compute addresses create <IP_NAME> --global
# 確認
$ gcloud compute addresses describe <IP_NAME> --global