
4

gcloud 切換帳號
source link: https://www.hwchiu.com/2023/10/01/gcp_gcloud
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

gcloud 切換帳號
October 1, 2023 · One min read
當環境中有多組 GCP 帳號要登入存取時,譬如一組個人帳號,一組 service account,這時後可以透過 gcloud 的一些指令才切換與檢視
$ gcloud config configurations list
NAME IS_ACTIVE ACCOUNT PROJECT COMPUTE_DEFAULT_ZONE COMPUTE_DEFAULT_REGION
default False [email protected] first-project
name2 False [email protected]
name3 True [email protected]
如果要切換可以使用
$ gcloud config configurations activate name2
進行切換,這時候 gcloud command 就可以轉移過去了。
如果有用 GKE 的,還要額外呼叫一次 gcloud container clusters update
去更新 KUBECONFIG
Tags:
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK