根據預設,Google Distributed Cloud 必須持續連線至Google Cloud 才能正常運作。這是因為使用 Google Distributed Cloud 建立的叢集預設為 Cloud 控制層叢集。換句話說,自動調度管理這類叢集上執行工作負載的 Kubernetes 控制層,會在 Google Cloud中執行。
如要提升 Distributed Cloud 的可靠性,您可以選擇建立使用本機控制層的 Distributed Cloud 叢集,並部署在 Distributed Cloud 硬體上。與 Google Cloud 的連線中斷時,這類叢集會進入存續能力模式,工作負載則會繼續執行。
只有使用本機控制層部署的 Distributed Cloud 叢集,才能在與Google Cloud 的連線中斷時進入存續模式。如果叢集部署時,雲端控制層在 Google Cloud 中執行,就無法進入存續模式。您無法重新設定現有叢集,從使用雲端控制層改為使用本機控制層。
使用本機控制層建立叢集時,請遵守下列規則:
- 您必須在自己的 Google Cloud 專案中建立本機控制層叢集。本機控制層叢集無法與任何其他類型的叢集 (包括非 Distributed Cloud 叢集) 共存在同一個 Google Cloud 專案 中。在同一個 Google Cloud 專案中,將本機控制平面 Distributed Cloud 叢集與任何其他類型的叢集混合使用,可能會導致資料遺失。
- 如果您在 Distributed Cloud 叢集之間重新指派節點,該節點會完全清除資料並重設為預設設定。
- 根據預設,本機控制層工作負載會以高可用性模式執行,並在 Distributed Cloud 自動選取的三個節點中,跨越三個副本。除非叢集中的節點少於三個,或您特別將叢集設定為使用一個節點執行本機控制層工作負載,否則就是如此。您也可以使用
--control-plane-machine-filter標記,為高可用性模式指定三個節點。系統不支援其他節點組合。 - 執行本機控制層工作負載的節點,也會執行應用程式工作負載。
- 您可以在區域網路存取本機控制層端點的 IP 位址。請務必確保本機網路的安全防護設定可防止外部存取這些 IP 位址。
處於存續性模式時,Distributed Cloud 叢集的運作方式如下:
- 透過 Google Cloud CLI、
kubectlCLI 和 Edge Container API 控制工作負載的功能已停用。 - 無法進行 Distributed Cloud 軟體更新、取得 SLO,以及維修硬體。
- 重新連線至 Google Cloud 後,系統會與 Google Cloud 同步處理有限的記錄和指標。
- 如果叢集與 Google Cloud中斷連線時節點重新啟動,節點就無法重新加入叢集,因為驗證金鑰無法重新整理,必須重新建立與 Google Cloud 的連線。
必要條件
如要使用本機控制平面建立 Distributed Cloud 叢集,必須先在目標 Google Cloud 專案中啟用必要 API。如要執行這項操作,您必須在 Google Cloud 專案中具備下列其中一個角色:
- 擁有者 (
roles/owner) - 編輯者 (
roles/editor) - 服務使用情形管理員 (
roles/serviceusage.serviceUsageAdmin)
如要進一步瞭解這些角色,請參閱「基本角色」。
如要瞭解如何授予角色,請參閱「授予單一角色」。
如要建立具有本機控制平面的 Distributed Cloud 叢集,請啟用下列 API:
anthos.googleapis.comanthosaudit.googleapis.comanthosgke.googleapis.comcloudresourcemanager.googleapis.comconnectgateway.googleapis.comcontainer.googleapis.comedgecontainer.googleapis.comgkeconnect.googleapis.comgkehub.googleapis.comgkeonprem.googleapis.comiam.googleapis.comlogging.googleapis.commonitoring.googleapis.comopsconfigmonitoring.googleapis.comserviceusage.googleapis.comstackdriver.googleapis.comstorage.googleapis.comsts.googleapis.com
如要瞭解如何啟用 API,請參閱「啟用服務」。
將 Google Cloud SDK 升級至 450.0.0 以上版本
如要建立執行 Distributed Cloud 軟體 1.5.0 版的本機控制平面叢集,請將 Google Cloud SDK 升級至 450.0.0 以上版本。否則建立這類叢集會失敗。
建立具有本機控制平面的叢集
如要建立具有本機控制平面的 Distributed Cloud 叢集,您必須在建立叢集時傳遞下列旗標:
--control-plane-node-location會指示 Distributed Cloud 在本機部署這個叢集的控制層工作負載。這個值是目標 Distributed Cloud 區域的名稱。--control-plane-node-count(選用) 指定要執行本機控制層工作負載的節點數量。有效值為3(高可用性) 和1(標準作業)。如果省略此屬性,系統會預設為3。--control-plane-machine-filter(選用) 指定以 regex 格式列出的節點,這些節點會執行本機控制層工作負載。如果省略,Distributed Cloud 會自動隨機選取節點。--control-plane-shared-deployment-policy指定應用程式工作負載是否可在執行本機控制層工作負載的節點上執行。唯一有效值為ALLOWED。如果省略,叢集建立作業就會失敗。--external-lb-ipv4-address-pools會指定以逗號分隔的 IPv4 位址、位址範圍或子網路清單,用於 Distributed Cloud 負載平衡器後方執行的 Service 傳入流量。
如要進一步瞭解如何建立 Distributed Cloud 叢集,請參閱「建立叢集」。