“gcloud容器集群创建失败”,带有“container.clusters.create”权限错误

时间:2018-05-20 20:57:51

标签: kubernetes google-cloud-platform gcloud

当我使用gcloud container clusters create命令创建kubernetes集群时,会发生权限错误,如下所示:

$ gcloud container clusters create my-k8s
WARNING: Currently node auto repairs are disabled by default. In the future this will change and they will be enabled by default. Use `--[no-]enable-autorepair` flag  to suppress this warning.
WARNING: Starting in Kubernetes v1.10, new clusters will no longer get compute-rw and storage-ro scopes added to what is specified in --scopes (though the latter will remain included in the default --scopes). To use these scopes, add them explicitly to --scopes. To use the new behavior, set container/new_scopes_behavior property (gcloud config set container/new_scopes_behavior true).
ERROR: (gcloud.container.clusters.create) ResponseError: code=403, message=Required "container.clusters.create" permission for "projects/test-project".

如何解决此错误?

由于

1 个答案:

答案 0 :(得分:4)

我可以从以下命令开始:

gcloud container clusters create my-k8s --project  test-project-xxxxxx 

注意:如果项目名称没有编号,则创建将失败,并显示相同的错误。

gcloud container clusters create my-k8s --project  test-project