我正在使用--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
时,将创建集群。我不确定,我认为没人能从应用程序反馈中看出错误的出处。
答案 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