Reputation: 964
Supposed that I create a new k8s cluster in console.cloud.google.com interface. Running kubectl config get-contexts
currently shows only the current cluster, not the new ones.
How do I fetch it locally so I can run the usual commands from my terminal on the new cluster?
Upvotes: 0
Views: 24
Reputation: 13260
You need to use the gcloud
command line tool.
First you need to install and setup it, you can follow the guide that suits your environment from the official page: https://cloud.google.com/sdk/downloads
After you need to run the following command:
gcloud container clusters get-credentials <clustername>
More details here: https://cloud.google.com/sdk/gcloud/reference/container/clusters/get-credentials
Upvotes: 1