跳至主要内容

設定 Out-of-tree VMware vSphere 雲端提供者

Kubernetes 正在從維護 in-tree 雲端提供者轉移。VMware vSphere 有一個 out-of-tree 雲端提供者,可以透過安裝 vSphere 雲端提供者和雲端儲存外掛程式來使用。

本頁介紹如何在設定叢集後安裝 Cloud Provider Interface (CPI) 和 Cloud Storage Interface (CSI) 外掛程式。

先決條件​

支援的 vSphere 版本:

  • 6.7u3
  • 7.0u1 或更高版本。

Kubernetes 版本必須為 1.19 或更高版本。

使用 vSphere out-of-tree 雲端提供者需要 Linux 節點,不支援 Windows。

安裝​

Cloud Provider Interface (CPI) 應該在安裝 Cloud Storage Interface (CSI) 之前先安裝。

1. 建立 VMware vSphere 叢集​

  1. 點擊 ☰ > Cluster Management。
  2. 在 Clusters 頁面上,點擊 Create。
  3. 點擊 VMware vSphere 或 Custom。
  4. 在 Cluster Configuration 部分的 Basics 標籤中,將 Cloud Provider 設定為 vSphere。
  5. 在 Add-On Config 標籤中,選擇 vSphere Cloud Provider (CPI) 和 Storage Provider (CSI) 選項。
  6. 完成叢集建立。

2. 安裝 CPI 外掛程式​

  1. 點擊 ☰ > Cluster Management。

  2. 前往將安裝 vSphere CPI 外掛程式的叢集,並點擊 Explore。

  3. 點擊 Apps > Charts。

  4. 點擊 vSphere CPI。

  5. 填寫所需的 vCenter 詳細資訊。

  6. vSphere CPI 使用 ProviderID 初始化所有節點,這是 vSphere CSI 驅動程式所需的。在安裝 CSI 驅動程式之前,使用以下命令檢查是否所有節點都已使用 ProviderID 初始化:

    kubectl describe nodes | grep "ProviderID"

3. 安裝 CSI 外掛程式​

  1. 點擊 ☰ > Cluster Management。
  2. 前往將安裝 vSphere CSI 外掛程式的叢集,並點擊 Explore。
  3. 點擊 Apps > Charts。
  4. 點擊 vSphere CSI。
  5. 點擊 Install。
  6. 填寫所需的 vCenter 詳細資訊。在 Features 標籤上,將 Enable CSI Migration 設定為 false。
  7. 在 Storage 標籤上,填寫 StorageClass 的詳細資訊。此 chart 會使用 csi.vsphere.vmware.com 作為佈建程式建立一個 StorageClass。
  8. 點擊 Install。

使用 CSI 驅動程式佈建磁碟區​

CSI chart 預設會建立一個 storageClass。

如果在啟動 chart 時未選擇該選項,請使用 csi.vsphere.vmware.com 作為佈建程式建立一個 storageClass。

使用此 StorageClass 佈建的所有磁碟區都將由 CSI 驅動程式佈建。