![](/img/trans.png)
[英]ERROR: (gcloud.beta.container.clusters.create) ResponseError: code=400, message=v1 API cannot be used to access GKE regional clusters
[英]ERROR: (gcloud.container.clusters.create) ResponseError: code=400, message=Failed
嗨,我收到以下錯誤
ERROR: (gcloud.container.clusters.create) ResponseError: code=400, message=Failed precondition when calling the ServiceConsumerManager: tenantmanager::185014: Consumer 370525719069 should enable service:container.googleapis.com before generating a service account
。
有人能幫我嗎 ?
您應該啟用 API 服務 - container.googleapis.com,執行命令:
$ gcloud services enable container.googleapis.com
請特別看一下這個介紹: GKE 上的環境設置和集群創建。
查看更多: gcp-enabling-disabling-services 、Troubleshooting-enabling-gcp-services 、 enable-gcp-services-example 。
另外的選擇:
由於缺乏重要的附加信息(例如環境),很難回答,但此類錯誤可能表明您正在使用某種多租戶環境。 確保您擁有創建新集群的適當權限:
使用 IAM 分配角色
您可以通過 IAM 政策控制對 GCP 資源的訪問。 首先確定您的組織所需的組及其操作范圍,然后為該組分配適當的 IAM 角色。 使用 Google 網上論壇為用戶有效分配和管理 IAM。
請參閱: 企業多租戶角色。
另請查看如何設置multi-tenant-cluster-gke-enterprise 的最佳實踐。
嘗試在共享 VPC 上創建 Google Kubernetes 集群時發生此錯誤。 共享 VPC 宿主項目缺少container.googleapis.com
API 激活。
在共享 VPC 宿主項目上激活container.googleapis.com
API 以解決此問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.