我为什么得到“(gcloud.alpha.container.clusters.create)ResponseError:代码= 404,消息=未找到方法。”在Alpha群集创建期间?

时间:2019-11-29 11:31:02

标签: kubernetes google-cloud-platform gcloud

我正在使用--enable-pod-security-policy创建一个Kubernetes Alpha集群,该集群仅在使用gcloud alpha而不是gcloud afaik时可用。我正在使用

$ gcloud alpha container clusters create cluster-name --machine-type=n1-standard-1 --no-enable-stackdriver-kubernetes --no-enable-autoupgrade --preemptible --enable-kubernetes-alpha --quiet --enable-pod-security-policy

由于

而失败
61 WARNING: Currently VPC-native is not the default mode during cluster creation. In the future, this will become the default mode and can be disabled using `--no-enable-ip-alias` flag. Use `--[no-]enable-ip-alias` flag to suppress this warning.
62 WARNING: Starting in 1.12, default node pools in new clusters will have their legacy Compute Engine instance metadata endpoints disabled by default. To create a cluster with legacy instance metadata endpoints disabled in the default node pool, run `clusters create` with the flag `--metadata disable-legacy-endpoints=true`.
63 WARNING: Your Pod address range (`--cluster-ipv4-cidr`) can accommodate at most 1008 node(s). 
64 ERROR: (gcloud.alpha.container.clusters.create) ResponseError: code=404, message=Method not found.

在没有gcloud的情况下,对以上命令使用gcloud alpha代替--enable-pod-security-policy时,将创建集群。我不确定,我认为没人能从应用程序反馈中看出错误的出处。

1 个答案:

答案 0 :(得分:1)

根据Cloud SDK release notes,在版本191.0.0中添加了--enable-pod-security-policy标志。

您应通过运行以下命令确保安装了最新的Cloud SDK:

$ gcloud components update

并使用beta关键字运行命令:

$ gcloud beta container clusters create cluster-name --machine-type=n1-standard-1 --no-enable-stackdriver-kubernetes --no-enable-autoupgrade --preemptible --enable-kubernetes-alpha --quiet --enable-pod-security-policy