將 Cloud Service Mesh (叢集內) 服務新增至服務範圍
Google Cloud 詳情請參閱「Cloud Service Mesh 總覽」。如果您在機構中建立了服務範圍,則在下列情況下,必須將憑證授權單位 (Cloud Service Mesh 憑證授權單位或憑證授權單位服務)、Mesh 設定、Stackdriver Logging、Cloud Monitoring 和 Cloud Trace 服務新增至服務範圍:
- 您已安裝 Cloud Service Mesh 的叢集位於某個服務範圍內的專案中。
- 您安裝 Cloud Service Mesh 的叢集是Shared VPC 網路中的服務專案。
將這些服務新增至服務範圍後,Cloud Service Mesh 叢集就能存取這些服務。服務存取權也會限制在叢集的虛擬私有雲 (VPC) 網路內。
如果未新增上述服務,可能會導致 Cloud Service Mesh 安裝失敗或缺少函式。舉例來說,如果您未將 Cloud Service Mesh 憑證授權單位新增至服務周圍區域,工作負載就無法從 Cloud Service Mesh 憑證授權單位取得憑證。
事前準備
VPC Service Controls 服務範圍的設定位於機構層級。確認您具備管理 VPC Service Controls 的適當角色。如果您有多個專案,可以將每個專案新增至服務邊界,對所有專案套用服務邊界。
將 Cloud Service Mesh 服務新增至現有服務範圍
控制台
- 按照「更新 service perimeter」一文中的步驟編輯範圍。
- 在「Edit VPC Service Perimeter」(編輯 VPC 服務範圍) 頁面中,按一下「Services to protect」(要保護的服務) 下方的「Add Services」(新增服務)。
- 在「Specify services to restrict」(指定要限制的服務) 對話方塊中,按一下「Filter services」(篩選服務)。視憑證授權單位 (CA) 而定,輸入 Cloud Service Mesh 憑證授權單位 API 或憑證授權單位服務 API。
- 勾選服務的核取方塊。
- 按一下「Add Cloud Service Mesh Certificate Authority API」(新增 Cloud Service Mesh 憑證授權單位 API)。
- 重複步驟 2 到 5,新增:
- Mesh Configuration API
- Cloud Monitoring API
- Cloud Trace API
- 按一下 [儲存]。
gcloud
如要更新受限服務清單,請使用 update 指令,並以半形逗號分隔清單指定要新增的服務:
gcloud access-context-manager perimeters update PERIMETER_NAME \ --add-restricted-services=meshconfig.googleapis.com,meshca.googleapis.com,monitoring.googleapis.com,cloudtrace.googleapis.com,OTHER_SERVICES \ --policy=POLICY_NAME
其中:
PERIMETER_NAME 是要更新的 service perimeter 名稱。
OTHER_SERVICES 是選填的半形逗號分隔清單,列出要納入 perimeter 的一或多項服務,以及前一個指令填入的服務。例如:
storage.googleapis.com,bigquery.googleapis.com。POLICY_NAME 是組織存取權政策的數字名稱。例如:
330193482019。
詳情請參閱「更新 service perimeter」。