1
votes

I created the kubernetes cluster and i am not able to connect to the cluster, getting below error.

rakesh_pal@sandbox:~$ gcloud beta container clusters get-credentials map-c1 --region us-central1 --project sandboxWarning: you invoked gcloud beta, but with current configurationKubernetes Engine v1 API will be used instead of v1beta1 API.If you intended to use v1beta1 API instead, please setcontainer/use_v1_api_client property to false.Do you want to continue (Y/n)? YFetching cluster endpoint and auth data.ERROR: (gcloud.beta.container.clusters.get-credentials) ResponseError: code=400, message='us-central1' is not a valid zone.rakesh_pal@sandbox:~$

Can you please help me on this.

2

2 Answers

4
votes

I succeeded after using this command:

gcloud config set container/use_v1_api false

0
votes

try without the beta and the region info in the command, your instructions might be old. container engine is not in beta anymore.

make sure your gcloud cli is current with

gcloud components update

then

gcloud container clusters get-credentials dev-map-c1 (created new cluster and same issue i have)

EDIT

In case your default config zone is not the one you want to use, you can explicitly specify it on the commands. The commands below work for me:

create cluster:

gcloud container clusters create dev-map-c1 --zone us-east1-b --machine-type=custom-1-4096 --cluster-version=1.8.4-gke.1

get config:

gcloud container clusters --zone=us-east1-b get-credentials dev-map-c1