本教學課程說明如何在多專案設定中使用二進位授權。如要簡化單一專案的設定,請參閱「開始使用 Google Cloud CLI (GKE)」。
如要建立權責劃分,您可以在多專案設定中設定二進位授權。本教學課程稍後會說明每個專案的用途。
目標
在本教學課程中,您將執行下列工作:為部署作業 (GKE)、驗證者和驗證管理設定不同的專案,以支援職責分離。
建立公開金鑰基礎架構 (X.509) (PKIX) 金鑰組,用於簽署驗證資料,並在稍後驗證。
建立驗證者,供二進位授權執行者用來驗證認證。
簽署範例圖片,建立驗證。
部署範例圖片來測試政策。
您必須透過 Identity and Access Management (IAM),為每個專案設定適當的存取控管。
如要進一步提升安全性,可以使用 VPC Service Controls 保護在本教學課程中建立的資源。詳情請參閱「使用 VPC Service Controls 確保安全」。
費用
在本文件中,您會使用下列 Google Cloud的計費元件:
如要根據預測用量估算費用,請使用 Pricing Calculator。
事前準備
- 登入 Google Cloud 帳戶。如果您是 Google Cloud新手,歡迎 建立帳戶,親自評估產品在實際工作環境中的成效。新客戶還能獲得價值 $300 美元的免費抵免額,可用於執行、測試及部署工作負載。
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
-
安裝 Google Cloud CLI。
-
若您採用的是外部識別資訊提供者 (IdP),請先使用聯合身分登入 gcloud CLI。
-
執行下列指令,初始化 gcloud CLI:
gcloud init -
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
-
安裝 Google Cloud CLI。
-
若您採用的是外部識別資訊提供者 (IdP),請先使用聯合身分登入 gcloud CLI。
-
執行下列指令,初始化 gcloud CLI:
gcloud init - 安裝
kubectl,以便與 GKE 互動。