ERROR: (gcloud.beta.container.clusters.create) ResponseError: code=400, message=v1 API cannot be used to access GKE regional clusters

3/15/2018

This tutorial of Google Kubernetes Engine seems not to work.

https://cloud.google.com/kubernetes-engine/docs/tutorials/hello-app

$ gcloud beta container clusters create hello-cluster --num-nodes=3
WARNING: You invoked `gcloud beta`, but with current configuration Kubernetes Engine v1 API will be used instead of v1beta1 API.
`gcloud beta` will switch to use Kubernetes Engine v1beta1 API by default by the end of March 2018.
If you want to keep using `gcloud beta` to talk to v1 API temporarily, please set `container/use_v1_api` property to true.
But we will drop the support for this property at the beginning of May 2018, please migrate if necessary.
ERROR: (gcloud.beta.container.clusters.create) ResponseError: code=400, message=v1 API cannot be used to access GKE regional clusters. See http:/goo.gl/Vykvt2 for more information.

It seems this command request GKE regional clusters but I have no idea how to stop it.

-- kujiy
google-cloud-platform
google-kubernetes-engine
kubernetes

3 Answers

6/25/2019

Ensure you specify the "project ID" not the "project name"

$ gcloud beta container clusters create hello-cluster --project=project-id --zone=europe-west1-a
-- Kadir Islow
Source: StackOverflow

2/24/2020

checkout the role of your service account.

-- Jingpeng Wu
Source: StackOverflow

3/15/2018

It worked well by adding --zone= option.

 gcloud container clusters create hello-cluster --num-nodes=3 --zone=asia-northeast1-a

You can find a proper zone name with the following command;

gcloud compute zones list

NAME and REGION are slightly different. Please remind to use NAME to the --zone= option.

You can find it in this Available regions & zones document also.

https://cloud.google.com/compute/docs/regions-zones/#available

Hope it helps.

-- kujiy
Source: StackOverflow