From the Google Cloud Shell, when I run kubectl
I am running it on the GKE cluster (cluster-1
) from my previous project (my-project-1
). I would like to run it on the gke cluster (cluster-2
) in my new project (my-project-2
).
How can I update my context to use the new cluster?
For me works this:
gcloud auth application-default login
gcloud config set project <your-project-name>
gcloud container clusters list
gcloud container clusters get-credentials <cluster-name> --region <cluster-region>
Then I was able to switch the context of kubectl