Skip to main content
Astra Trident
此產品有較新版本可以使用。
本繁體中文版使用機器翻譯,譯文僅供參考,若與英文版本牴觸,應以英文版本為準。

使用tridentctl進行升級

貢獻者 juliantap

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

使用升級 Astra Trident tridentctl

解除安裝和重新安裝Astra Trident可做為升級。當您解除安裝Trident時、不會刪除由Astra Trident部署所使用的持續磁碟區宣告(PVc)和持續磁碟區(PV)。當Astra Trident離線時、已配置的PV仍可繼續使用、而Astra Trident會在任何建立於過渡期間的永久虛電路恢復上線後、為其配置磁碟區。

開始之前

在使用 `tridentctl`進行升級之前,請先檢查"選擇升級方法"

步驟
  1. 在中執行解除安裝命令 tridentctl 移除與 Astra Trident 相關的所有資源、但 CRD 和相關物件除外。

    ./tridentctl uninstall -n <namespace>
  2. 重新安裝 Astra Trident。請參閱 "使用tridentctl安裝Astra Trident"

重要 請勿中斷升級程序。確保安裝程式執行完成。

使用升級磁碟區 tridentctl

升級後、您可以使用較新的 Trident 版本(例如隨選 Volume Snapshot )所提供的豐富功能集、使用來升級磁碟區 tridentctl upgrade 命令。

如果有舊版磁碟區、您應該將它們從 NFS 或 iSCSI 類型升級至 CSI 類型、以使用 Astra Trident 中的完整新功能集。Trident提供的舊PV支援傳統功能集。

開始之前

在決定將磁碟區升級為 CSI 類型之前、請考量下列事項:

  • 您可能不需要升級所有磁碟區。先前建立的磁碟區將繼續可供存取、並正常運作。

  • 在升級時、PV可作為部署/狀態集的一部分掛載。不需要關閉部署/狀態集。

  • 您*無法*在升級時將PV附加至獨立式Pod。在升級磁碟區之前、您應該先關閉Pod。

  • 您只能升級綁定到PVc的磁碟區。在升級之前、應先移除和匯入未繫結至PVCS的磁碟區。

步驟
  1. 執行 kubectl get pv 以列出PV。

    kubectl get pv
    NAME                         CAPACITY     ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                  STORAGECLASS    REASON   AGE
    default-pvc-1-a8475          1073741824   RWO            Delete           Bound    default/pvc-1          standard                 19h
    default-pvc-2-a8486          1073741824   RWO            Delete           Bound    default/pvc-2          standard                 19h
    default-pvc-3-a849e          1073741824   RWO            Delete           Bound    default/pvc-3          standard                 19h
    default-pvc-4-a84de          1073741824   RWO            Delete           Bound    default/pvc-4          standard                 19h
    trident                      2Gi          RWO            Retain           Bound    trident/trident                                 19h

    目前有四個PV是由Trident 20.07使用所建立 netapp.io/trident 置備程式:

  2. 執行 kubectl describe pv 以取得PV的詳細資料。

    kubectl describe pv default-pvc-2-a8486
    
    Name:            default-pvc-2-a8486
    Labels:          <none>
    Annotations:     pv.kubernetes.io/provisioned-by: netapp.io/trident
                     volume.beta.kubernetes.io/storage-class: standard
    Finalizers:      [kubernetes.io/pv-protection]
    StorageClass:    standard
    Status:          Bound
    Claim:           default/pvc-2
    Reclaim Policy:  Delete
    Access Modes:    RWO
    VolumeMode:      Filesystem
    Capacity:        1073741824
    Node Affinity:   <none>
    Message:
    Source:
        Type:      NFS (an NFS mount that lasts the lifetime of a pod)
        Server:    10.xx.xx.xx
        Path:      /trid_1907_alpha_default_pvc_2_a8486
        ReadOnly:  false

    PV是使用建立的 netapp.io/trident 資源配置程式、類型為NFS。為了支援Astra Trident提供的所有新功能、此PV應升級為「csi」類型。

  3. 執行 tridentctl upgrade volume <name-of-trident-volume> 將舊Astra Trident Volume升級至csi規格的命令。

    ./tridentctl get volumes -n trident
    +---------------------+---------+---------------+----------+--------------------------------------+--------+---------+
    |            NAME     |  SIZE   | STORAGE CLASS | PROTOCOL |             BACKEND UUID             | STATE  | MANAGED |
    +---------------------+---------+---------------+----------+--------------------------------------+--------+---------+
    | default-pvc-2-a8486 | 1.0 GiB | standard      | file     | c5a6f6a4-b052-423b-80d4-8fb491a14a22 | online | true    |
    | default-pvc-3-a849e | 1.0 GiB | standard      | file     | c5a6f6a4-b052-423b-80d4-8fb491a14a22 | online | true    |
    | default-pvc-1-a8475 | 1.0 GiB | standard      | file     | c5a6f6a4-b052-423b-80d4-8fb491a14a22 | online | true    |
    | default-pvc-4-a84de | 1.0 GiB | standard      | file     | c5a6f6a4-b052-423b-80d4-8fb491a14a22 | online | true    |
    +---------------------+---------+---------------+----------+--------------------------------------+--------+---------+
    
    ./tridentctl upgrade volume default-pvc-2-a8486 -n trident
    +---------------------+---------+---------------+----------+--------------------------------------+--------+---------+
    |            NAME     |  SIZE   | STORAGE CLASS | PROTOCOL |             BACKEND UUID             | STATE  | MANAGED |
    +---------------------+---------+---------------+----------+--------------------------------------+--------+---------+
    | default-pvc-2-a8486 | 1.0 GiB | standard      | file     | c5a6f6a4-b052-423b-80d4-8fb491a14a22 | online | true    |
    +---------------------+---------+---------------+----------+--------------------------------------+--------+---------+
  4. 執行 kubectl describe pv 以驗證Volume是否為「csi Volume」(SCSI Volume)。

    kubectl describe pv default-pvc-2-a8486
    Name:            default-pvc-2-a8486
    Labels:          <none>
    Annotations:     pv.kubernetes.io/provisioned-by: csi.trident.netapp.io
                     volume.beta.kubernetes.io/storage-class: standard
    Finalizers:      [kubernetes.io/pv-protection]
    StorageClass:    standard
    Status:          Bound
    Claim:           default/pvc-2
    Reclaim Policy:  Delete
    Access Modes:    RWO
    VolumeMode:      Filesystem
    Capacity:        1073741824
    Node Affinity:   <none>
    Message:
    Source:
        Type:              CSI (a Container Storage Interface (CSI) volume source)
        Driver:            csi.trident.netapp.io
        VolumeHandle:      default-pvc-2-a8486
        ReadOnly:          false
        VolumeAttributes:      backendUUID=c5a6f6a4-b052-423b-80d4-8fb491a14a22
                               internalName=trid_1907_alpha_default_pvc_2_a8486
                               name=default-pvc-2-a8486
                               protocol=file
    Events:                <none>