Skip to main content
本繁體中文版使用機器翻譯,譯文僅供參考,若與英文版本牴觸,應以英文版本為準。

手動部署Trident運算子(標準模式)

貢獻者 netapp-aruldeepa juliantap joan-ing netapp-mwallis netapp-shwetav

您可以手動部署 Trident 操作員來安裝 Trident 。此程序適用於 Trident 所需的容器映像未儲存在私有登錄中的安裝。如果您有私有映像登錄,請使用"離線部署程序"。

關於 Trident 26.06 的關鍵資訊

  • 您必須閱讀下列有關 Trident 的重要資訊。 *

<strong> 的 Trident </strong> 相關資訊
  • Trident 現在支援 Kubernetes 1.36。請先升級 Trident,再升級 Kubernetes。

  • Trident 嚴格強制在 SAN 環境中使用多重路徑組態、建議在 multipath.conf 檔案中使用值 find_multipaths: no。

    使用非多重路徑組態或使用 find_multipaths: yes 或 find_multipaths: smart 多重路徑.conf檔案中的值會導致掛載失敗。Trident建議使用 find_multipaths: no 自21.07版本以來。

手動部署Trident運算子並安裝Trident

檢查 "安裝總覽" 以確保滿足安裝先決條件並為您的環境選擇了正確的安裝選項。

開始之前

在開始安裝之前,請登入 Linux 主機並驗證它是否正在管理運作中的 "支援的Kubernetes叢集",以及您是否擁有必要的權限。

註 使用OpenShift時、請在所有範例中使用「oc"而非「kubecll」、然後先執行「ocLogin -u system:admin」或「occ login-u kube-admin」、以*系統:admin*登入。
Details
  1. 驗證Kubernetes版本:

    kubectl version
  2. 驗證叢集管理員權限:

    kubectl auth can-i '*' '*' --all-namespaces
  3. 確認您可以啟動使用Docker Hub映像的Pod、並透過Pod網路連線至儲存系統:

    kubectl run -i --tty ping --image=busybox --restart=Never --rm -- \
      ping <management IP>

步驟1:下載Trident安裝程式套件

Trident 安裝程式套件包含部署 Trident 營運商和安裝 Trident 所需的一切。從下載並解壓縮最新版本"GitHub的_Assets區段"的Trident 安裝程式。

wget https://github.com/NetApp/trident/releases/download/v26.06.0/trident-installer-26.06.0.tar.gz
tar -xf trident-installer-26.06.0.tar.gz
cd trident-installer

步驟2:建立 TridentOrchestrator 客戶需求日

創建 `TridentOrchestrator`自訂資源定義(CRD)。您將創建一個 `TridentOrchestrator`稍後自訂資源。使用適當的 CRD YAML 版本 `deploy/crds`創建 `TridentOrchestrator`CRD。

kubectl create -f deploy/crds/trident.netapp.io_tridentorchestrators_crd_post1.16.yaml

步驟3:部署Trident運算子

Trident 安裝程式提供套件檔案、可用於安裝操作員及建立相關物件。套件檔案是部署操作員及使用預設組態安裝 Trident 的簡單方法。

  • 對於運行 Kubernetes 1.24 的羣集,請使用 bundle_pre_1_25.yaml。

  • 對於執行 Kubernetes 1.25 或更新版本的叢集、請使用 bundle_post_1_25.yaml。

開始之前
  • 根據預設、 Trident 安裝程式會在中部署運算子 trident 命名空間。如果是 trident 命名空間不存在、請使用以下方式建立:

    kubectl apply -f deploy/namespace.yaml
  • 可在非的命名空間中部署運算子 trident 命名空間、更新 serviceaccount.yaml、 clusterrolebinding.yaml 和 operator.yaml 並使用產生套裝組合檔案 kustomization.yaml。

    1. 建立 kustomization.yaml 使用下列命令、其中包含 <bundle.yaml> bundle_pre_1_25.yaml 或 bundle_post_1_25.yaml 以 Kubernetes 版本為基礎。

      cp deploy/kustomization_<bundle.yaml> deploy/kustomization.yaml
    2. 使用以下命令編譯套件(其中的 <bundle.yaml> 是) bundle_pre_1_25.yaml 或 bundle_post_1_25.yaml 以 Kubernetes 版本為基礎。

      kubectl kustomize deploy/ > deploy/<bundle.yaml>
步驟
  1. 建立資源並部署營運者:

    kubectl create -f deploy/<bundle.yaml>
  2. 確認已建立運算子、部署和複本集。

    kubectl get all -n <operator-namespace>
重要 Kubernetes叢集中只應有*一個運算子執行個體*。請勿建立Trident營運者的多個部署。

步驟4:建立 TridentOrchestrator 並安裝Trident

您現在可以建立 TridentOrchestrator`並安裝 Trident 。您也可以選擇"自訂您的Trident安裝"使用規格中的屬性 `TridentOrchestrator。

kubectl create -f deploy/crds/tridentorchestrator_cr.yaml
tridentorchestrator.trident.netapp.io/trident created

kubectl describe torc trident

Name:        trident
Namespace:
Labels:      <none>
Annotations: <none>
API Version: trident.netapp.io/v1
Kind:        TridentOrchestrator
...
Spec:
  Debug:     true
  Namespace: trident
  nodePrep:
  - iscsi
Status:
  Current Installation Params:
    IPv6:                      false
    Autosupport Hostname:
    Autosupport Image:         netapp/trident-autosupport:26.06
    Autosupport Proxy:
    Autosupport Serial Number:
    Debug:                     true
    Image Pull Secrets:
    Image Registry:
    k8sTimeout:           30
    Kubelet Dir:          /var/lib/kubelet
    Log Format:           text
    Silence Autosupport:  false
    Trident Image:        netapp/trident:26.06.0
  Message:                  Trident installed  Namespace:                trident
  Status:                   Installed
  Version:                  v26.06.0
Events:
    Type Reason Age From Message ---- ------ ---- ---- -------Normal
    Installing 74s trident-operator.netapp.io Installing Trident Normal
    Installed 67s trident-operator.netapp.io Trident installed

驗證安裝

驗證安裝的方法有多種。

使用 TridentOrchestrator 狀態

狀態 TridentOrchestrator 指出安裝是否成功、並顯示安裝的Trident版本。安裝期間的狀態 TridentOrchestrator 變更來源 Installing 至 Installed。如果您觀察到 Failed 狀態、而且營運者無法自行恢復、 "檢查記錄"。

狀態 說明

安裝

操作人員正在使用此 CR 安裝 Trident TridentOrchestrator 。

已安裝

Trident 已成功安裝。

正在解除安裝

操作員正在解除安裝 Trident 、因為
spec.uninstall=true。

已解除安裝

Trident 已解除安裝。

失敗

操作員無法安裝、修補、更新或解除安裝 Trident ;操作員將自動嘗試從此狀態恢復。如果此狀態持續存在、您將需要疑難排解。

正在更新

營運者正在更新現有的安裝。

錯誤

不使用「TridentOrchestrator」。另一個已經存在。

使用Pod建立狀態

您可以檢閱建立的 Pod 狀態、確認 Trident 安裝是否已完成:

kubectl get pods -n trident

NAME                                       READY   STATUS    RESTARTS   AGE
trident-controller-7d466bf5c7-v4cpw        6/6     Running   0           1m
trident-node-linux-mr6zc                   2/2     Running   0           1m
trident-node-linux-xrp7w                   2/2     Running   0           1m
trident-node-linux-zh2jt                   2/2     Running   0           1m
trident-operator-766f7b8658-ldzsv          1/1     Running   0           3m

使用 tridentctl

您可以使用 `tridentctl`檢查已安裝的 Trident 版本。

./tridentctl -n trident version

+----------------+----------------+
| SERVER VERSION | CLIENT VERSION |
+----------------+----------------+
| 26.06.0        | 26.06.0        |
+----------------+----------------+