Chris Stryczynski
Chris Stryczynski

Reputation: 33861

kubectl does not have config changed when gcloud config changes for Google Cloud Platform project

I switched the project config for gcloud using gcloud config set project abcxyz, however kubectl get pods is returning the pods in the previous gcloud / kubernetes project.

How do I update the project config to match gcloud's config?

Upvotes: 3

Views: 636

Answers (1)

sharif9876
sharif9876

Reputation: 680

After you've changed project, run:

gcloud container clusters get-credentials <cluster_name>

gcloud will then set kubectl to be looking at your new project.

Upvotes: 7

Related Questions