I ran into this issue when I setup my cluster with the cloud cli and then later went on installing the cloud sdk tool and kubernetes on my local.

First find in the kubernets section the environment you are in. Mine was europe-west.

Then go to your terminal (local) and set the environment to the same string as your cluster is on:

gcloud config set compute/zone europe-west1-b

Next point to the correct cluster

gcloud config set container/cluster mycluster

And then download the credentials for kubectl

gcloud container clusters get-credentials mycluster

Leave a Reply

Your email address will not be published. Required fields are marked *