错误:(gcloud.beta.container.clusters.create) ResponseError: code=400, message=v1 API 无法用于访问 GKE 区域集群

kuj*_*jiy 2 google-cloud-platform kubernetes google-kubernetes-engine

Google Kubernetes Engine 的这个教程似乎不起作用。

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.
Run Code Online (Sandbox Code Playgroud)

似乎有这个命令请求GKE regional clusters,但我不知道如何阻止它。

kuj*_*jiy 5

--zone=通过添加选项效果很好。

 gcloud container clusters create hello-cluster --num-nodes=3 --zone=asia-northeast1-a
Run Code Online (Sandbox Code Playgroud)

您可以使用以下命令找到合适的区域名称;

gcloud compute zones list
Run Code Online (Sandbox Code Playgroud)

NAME并且REGION略有不同。请提醒使用NAME--zone=选项。

您也可以在本文档中找到它Available regions & zones

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

希望能帮助到你。