Adi Fatol
Adi Fatol

Reputation: 964

How do I fetch automatically new kubernetes clusters created manually on google cloud

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

Answers (1)

whites11
whites11

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

Related Questions