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

與營運者一起升級

貢獻者

您可以使用業者輕鬆升級現有的Astra Trident安裝。

您需要的產品

若要使用營運者進行升級、應符合下列條件:

  • 您應該安裝以「服務整合式」為基礎的Astra Trident。若要檢查您是否正在執行csi Trident、請檢查Trident命名空間中的Pod。如果他們遵循「Trident - csi*」命名模式、您就會執行「csi Trident」。

  • 您應該安裝CRD型Trident。這代表19.07及更新版本的所有版本。如果您安裝的是基於SCSI的安裝、則很可能是以CRD為基礎的安裝。

  • 如果您已解除安裝了「csi Trident」、而且安裝中的中繼資料持續存在、您可以使用操作者進行升級。

  • 在特定Kubernetes叢集中的所有命名空間中、只應有一個Astra Trident安裝。

  • 您應該使用執行的Kubernetes叢集 "版本1.18 - 1.24"

  • 如果存在Alpha Snapshot CRD、您應該使用「tridentctl obliviate alpha-snapshot -crd」來移除。這會刪除Alpha Snapshot規格的客戶需求日。如需應刪除/移轉的現有快照、請參閱 "這篇部落格"

警告 使用OpenShift Container Platform上的運算子來升級Trident時、您應該升級至Trident 21.01.1或更新版本。隨21.01.0一起發行的Trident運算子包含已在21.01.1中修正的已知問題。如需詳細資訊、請參閱 "GitHub問題詳細資料"

升級叢集範圍內的操作員安裝

若要從* Trident 21.01*及更新版本*升級、請依照下列步驟進行。

步驟
  1. 刪除用來安裝目前Astra Trident執行個體的Trident運算子。例如、如果您要從21.01升級、請執行下列命令:

    kubectl delete -f 21.01/trident-installer/deploy/bundle.yaml -n trident
  2. (選用)如果您想要修改安裝參數、請編輯您在安裝Trident時所建立的「TridentOrchestrator」物件。這可能包括修改自訂Trident映像、從私有映像登錄擷取容器映像、啟用偵錯記錄或指定映像提取機密等變更。

  3. 使用「bunder.yaml」檔案來安裝Astra Trident、該檔案可設定新版本的Trident運算子。執行下列命令:

    kubectl create -f 21.10.0/trident-installer/deploy/bundle.yaml -n trident

在此步驟中、21.10.0 Trident營運者將識別現有的Astra Trident安裝、並將其升級至與營運者相同的版本。

升級命名空間範圍內的操作員安裝

若要從使用命名空間範圍運算子(20.07到20.10版)安裝的Astra Trident執行個體進行升級、請遵循下列步驟:

步驟
  1. 確認現有Trident安裝的狀態。要執行此操作、請查看「TridentProvisioner」的*狀態*。狀態應為「Installed」(已安裝)。

    $ kubectl describe tprov trident -n trident | grep Message: -A 3
    Message:  Trident installed
    Status:   Installed
    Version:  v20.10.1
    註 如果狀態顯示 Updating、請務必先解決此問題、再繼續進行。如需可能狀態值的清單、請參閱 "請按這裡"
  2. 使用Trident安裝程式提供的資訊清單、建立「TridentOrchestrator」CRD。

    # Download the release required [21.01]
    $ mkdir 21.07.1
    $ cd 21.07.1
    $ wget https://github.com/NetApp/trident/releases/download/v21.07.1/trident-installer-21.07.1.tar.gz
    $ tar -xf trident-installer-21.07.1.tar.gz
    $ cd trident-installer
    $ kubectl create -f deploy/crds/trident.netapp.io_tridentorchestrators_crd_post1.16.yaml
  3. 使用命名空間範圍的運算子資訊清單來刪除。若要完成此步驟、您需要使用「bunder.yaml」檔案來部署命名空間範圍的運算子。您可以從取得「bunder.yaml」 "Trident儲存庫"。請務必使用適當的分行。

    註 您應該對Trident安裝參數進行必要的變更(例如、變更的值) tridentImageautosupportImage、私有映像儲存庫、以及提供 imagePullSecrets)刪除命名空間範圍的運算子之後、安裝叢集範圍的運算子之前。如需可更新的完整參數清單、請參閱 "參數清單"
    #Ensure you are in the right directory
    $ pwd
    $ /root/20.10.1/trident-installer
    
    #Delete the namespace-scoped operator
    $ kubectl delete -f deploy/bundle.yaml
    serviceaccount "trident-operator" deleted
    clusterrole.rbac.authorization.k8s.io "trident-operator" deleted
    clusterrolebinding.rbac.authorization.k8s.io "trident-operator" deleted
    deployment.apps "trident-operator" deleted
    podsecuritypolicy.policy "tridentoperatorpods" deleted
    
    #Confirm the Trident operator was removed
    $ kubectl get all -n trident
    NAME                               READY   STATUS    RESTARTS   AGE
    pod/trident-csi-68d979fb85-dsrmn   6/6     Running   12         99d
    pod/trident-csi-8jfhf              2/2     Running   6          105d
    pod/trident-csi-jtnjz              2/2     Running   6          105d
    pod/trident-csi-lcxvh              2/2     Running   8          105d
    
    NAME                  TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)              AGE
    service/trident-csi   ClusterIP   10.108.174.125   <none>        34571/TCP,9220/TCP   105d
    
    NAME                         DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR                                     AGE
    daemonset.apps/trident-csi   3         3         3       3            3           kubernetes.io/arch=amd64,kubernetes.io/os=linux   105d
    
    NAME                          READY   UP-TO-DATE   AVAILABLE   AGE
    deployment.apps/trident-csi   1/1     1            1           105d
    
    NAME                                     DESIRED   CURRENT   READY   AGE
    replicaset.apps/trident-csi-68d979fb85   1         1         1       105d

    在這個階段、「Trident - oper-xxxxxx-xxxxx" pod會刪除。

  4. (選用)如果需要修改安裝參數、請更新「TridentProvisioner」規格。這些變更可能包括:修改私有映像登錄以從擷取容器映像、啟用偵錯記錄或指定映像提取機密。

    $  kubectl patch tprov <trident-provisioner-name> -n <trident-namespace> --type=merge -p '{"spec":{"debug":true}}'
  5. 安裝叢集範圍的運算子。

    註 安裝叢集範圍的運算子會將「TridentProvisioner」物件移轉至「TridentOrchestrator」物件、刪除「TridentProvisioner」物件和「Trident置 備程式」CRD、並將Astra Trident升級至所使用的叢集範圍運算子版本。在接下來的範例中、Trident已升級至21.07.1。
    重要 使用叢集範圍的運算子來升級Astra Trident、會將「TridentProvisioner」移轉至名稱相同的「tridentOrchestrator」物件。這會由操作員自動處理。升級也會將Astra Trident安裝在與之前相同的命名空間中。
    #Ensure you are in the correct directory
    $ pwd
    $ /root/21.07.1/trident-installer
    
    #Install the cluster-scoped operator in the **same namespace**
    $ kubectl create -f deploy/bundle.yaml
    serviceaccount/trident-operator created
    clusterrole.rbac.authorization.k8s.io/trident-operator created
    clusterrolebinding.rbac.authorization.k8s.io/trident-operator created
    deployment.apps/trident-operator created
    podsecuritypolicy.policy/tridentoperatorpods created
    
    #All tridentProvisioners will be removed, including the CRD itself
    $ kubectl get tprov -n trident
    Error from server (NotFound): Unable to list "trident.netapp.io/v1, Resource=tridentprovisioners": the server could not find the requested resource (get tridentprovisioners.trident.netapp.io)
    
    #tridentProvisioners are replaced by tridentOrchestrator
    $ kubectl get torc
    NAME      AGE
    trident   13s
    
    #Examine Trident pods in the namespace
    $ kubectl get pods -n trident
    NAME                                READY   STATUS    RESTARTS   AGE
    trident-csi-79df798bdc-m79dc        6/6     Running   0          1m41s
    trident-csi-xrst8                   2/2     Running   0          1m41s
    trident-operator-5574dbbc68-nthjv   1/1     Running   0          1m52s
    
    #Confirm Trident has been updated to the desired version
    $ kubectl describe torc trident | grep Message -A 3
    Message:                Trident installed
    Namespace:              trident
    Status:                 Installed
    Version:                v21.07.1

升級Helm型的營運者安裝

請執行下列步驟、升級Helm型的操作員安裝。

步驟
  1. 下載最新的Astra Trident版本。

  2. 使用「helm升級」命令。請參閱下列範例:

    $ helm upgrade <name> trident-operator-21.07.1.tgz

    其中「trident操作者-21.07.1.tgz」代表您要升級的版本。

  3. 執行「helm清單」、確認圖表和應用程式版本都已升級。

註 若要在升級期間傳遞組態資料、請使用「-set」。

例如、若要變更預設值「tridentDebug」、請執行下列命令:

$ helm upgrade <name> trident-operator-21.07.1-custom.tgz --set tridentDebug=true

如果您執行「$ tridentctl logs」、就會看到偵錯訊息。

註 如果您在初始安裝期間設定任何非預設選項、請確定升級命令中已包含這些選項、否則這些值將會重設為預設值。

從非營運者安裝升級

如果您有符合上述先決條件的「SCSI Trident」執行個體、您可以升級至Trident運算子的最新版本。

步驟
  1. 下載最新的Astra Trident版本。

    # Download the release required [21.07.1]
    $ mkdir 21.07.1
    $ cd 21.07.1
    $ wget https://github.com/NetApp/trident/releases/download/v21.07.1/trident-installer-21.07.1.tar.gz
    $ tar -xf trident-installer-21.07.1.tar.gz
    $ cd trident-installer
  2. 從資訊清單建立「TridentOrchestrator」CRD。

    $ kubectl create -f deploy/crds/trident.netapp.io_tridentorchestrators_crd_post1.16.yaml
  3. 部署營運者。

    #Install the cluster-scoped operator in the **same namespace**
    $ kubectl create -f deploy/bundle.yaml
    serviceaccount/trident-operator created
    clusterrole.rbac.authorization.k8s.io/trident-operator created
    clusterrolebinding.rbac.authorization.k8s.io/trident-operator created
    deployment.apps/trident-operator created
    podsecuritypolicy.policy/tridentoperatorpods created
    
    #Examine the pods in the Trident namespace
    NAME                                READY   STATUS    RESTARTS   AGE
    trident-csi-79df798bdc-m79dc        6/6     Running   0          150d
    trident-csi-xrst8                   2/2     Running   0          150d
    trident-operator-5574dbbc68-nthjv   1/1     Running   0          1m30s
  4. 建立「TridentOrchestrator」、以安裝Astra Trident。

    #Create a tridentOrchestrator to initate a Trident install
    $ cat deploy/crds/tridentorchestrator_cr.yaml
    apiVersion: trident.netapp.io/v1
    kind: TridentOrchestrator
    metadata:
      name: trident
    spec:
      debug: true
      namespace: trident
    
    $ kubectl create -f deploy/crds/tridentorchestrator_cr.yaml
    
    #Examine the pods in the Trident namespace
    NAME                                READY   STATUS    RESTARTS   AGE
    trident-csi-79df798bdc-m79dc        6/6     Running   0          1m
    trident-csi-xrst8                   2/2     Running   0          1m
    trident-operator-5574dbbc68-nthjv   1/1     Running   0          5m41s
    
    #Confirm Trident was upgraded to the desired version
    $ kubectl describe torc trident | grep Message -A 3
    Message:                Trident installed
    Namespace:              trident
    Status:                 Installed
    Version:                v21.07.1

現有的後端和PVCS會自動提供使用。