Google-Cloud-Platform
Google云:未能刪除集群:compute.instanceGroups.update
刪除集群時:
gcloud container clusters delete demo
我經常遇到以下錯誤消息:
ERROR: (gcloud.container.clusters.delete) Some requests did not succeed: - args: ['Operation [<Operation clusterConditions: [<StatusCondition canonicalCode: CanonicalCodeValueValuesEnum(PERMISSION_DENIED, 7) message: "Google Compute Engine: Required \'compute.instanceGroups.update\' permission for \'gke-demo-default-pool-11319969-grp\'.">] detail: "Google Compute Engine: Required \'compute.instanceGroups.update\' permission for \'gke-demo-default-pool-11319969-grp\'." endTime: \'2021-04-21T17:31:06.780378597Z\' error: <Status code: 7 details: [] message: "Google Compute Engine: Required \'compute.instanceGroups.update\' permission for \'gke-demo-default-pool-11319969-grp\'."> name: \'operation-1619026203457-4c931621\' nodepoolConditions: [] operationType: OperationTypeValueValuesEnum(DELETE_CLUSTER, 2) selfLink: \'https://container.googleapis.com/v1/projects/824185028708/zones/us-west1-a/operations/operation-1619026203457-4c931621\' startTime: \'2021-04-21T17:30:03.457738447Z\' status: StatusValueValuesEnum(DONE, 3) statusMessage: "Google Compute Engine: Required \'compute.instanceGroups.update\' permission for \'gke-demo-default-pool-11319969-grp\'." targetLink: \'https://container.googleapis.com/v1/projects/824185028708/zones/us-west1-a/clusters/demo\' zone: \'us-west1-a\'>] finished with error: Google Compute Engine: Required \'compute.instanceGroups.update\' permission for \'gke-demo-default-pool-11319969-grp\'.'] exit_code: 1
它似乎與這篇文章相似。但是將“編輯”角色添加到我找到的所有服務帳戶後,刪除命令仍然失敗。
更新:根據是否檢查Activity,真正試圖刪除集群創建的實例組的“使用者”是“
$$ 12DigitNumber $$@cloudservices.gserviceaccount.com”。 有任何想法嗎?
在檢查了活動頁面並查閱了有關服務帳戶的 Google 文件後,我意識到這是由先前的錯誤引起的,該錯誤刪除了 Google 創建的預設服務帳戶。為了把它帶回來,我使用了:
gcloud projects add-iam-policy-binding PROJECT_ID \ --member serviceAccount:PROJECT_NUMBER@cloudservices.gserviceaccount.com \ --role roles/editor
該錯誤表示缺少權限,無法繼續刪除。您可以設置所需的權限並重試刪除嗎?權限要求:“compute.instanceGroups.update”
請按照以下步驟添加所需的權限:
- 轉到導航菜單,然後點擊 IAM 和管理員
- 現在選擇
- 點擊成員的“編輯”或鉛筆圖示
- 選擇 + 添加另一個角色
- 在“選擇角色”中查找 Compute Engine,然後點擊 Compute Admin。