0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

GCP - gcloud コマンド

Last updated at Posted at 2020-12-18

認証情報を確認

gcloud auth list

k8s関連で使うコマンド

kubectl config get-contexts

gcloud container clusters list --project=PROJECT_ID
gcloud container clusters get-credentials CLUDTER_NAME --project=PROJECT_ID --zone=ZONE_NAME

GCP - アカウント管理

設定リストを確認

% gcloud config configurations list
NAME     IS_ACTIVE  ACCOUNT                 PROJECT      COMPUTE_DEFAULT_ZONE  COMPUTE_DEFAULT_REGION
default  True       アカウント@gmail.com  プロジェクトID

設定の作成/切り替え

# 新しい設定を作成
% gcloud config configurations create setting-name --activate
# アカウントを切り替えるとき
% gcloud config configurations activate setting-name

設定を追加

% gcloud config set core/project プロジェクトID
% gcloud config set core/account サービスアカウント
% gcloud config set compute/region asia-northeast1
% gcloud config set compute/zone asia-northeast1-a

アカウント認証

% gcloud auth activate-service-account --key-file ~/Documents/gcp/key/pub-sub-key.json

docker認証

gcloud auth configure-docker
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?