Upgrade with tridentctl

Contributors netapp-amitha Download PDF of this page

You can easily upgrade an existing Astra Trident installation by using tridentctl.

Considerations

When upgrading to the latest release of Astra Trident, consider the following:

  • Starting with Trident 20.01, only the beta release of volume snapshots is supported. Kubernetes administrators should take care to safely back up or convert the alpha snapshot objects to beta to retain the legacy alpha snapshots.

  • The beta release of volume snapshots introduces a modified set of CRDs and a snapshot controller, both of which should be set up before installing Astra Trident.

Note This blog discusses the steps involved in migrating alpha volume snapshots to the beta format.
About this task

Uninstalling and reinstalling Astra Trident acts as an upgrade. When you uninstall Trident, the Persistent Volume Claim (PVC) and Persistent Volume (PV) used by the Astra Trident deployment are not deleted. PVs that have already been provisioned will remain available while Astra Trident is offline, and Astra Trident will provision volumes for any PVCs that are created in the interim once it is back online.

Important When upgrading Astra Trident, do not interrupt the upgrade process. Ensure that the installer runs to completion.

Next steps after upgrade

To make use of the rich set of features that are available in newer Trident releases (such as, On-Demand Volume Snapshots), you can upgrade the volumes by using the tridentctl upgrade command.

If there are legacy volumes, you should upgrade them from a NFS/iSCSI type to the CSI type to be able to use the complete set of new features in Astra Trident. A legacy PV that has been provisioned by Trident supports the traditional set of features.

Consider the following when deciding to upgrade volumes to the CSI type:

  • You might not need to upgrade all the volumes. Previously created volumes will continue to be accessible and function normally.

  • A PV can be mounted as part of a deployment/StatefulSet when upgrading. It is not required to bring down the deployment/StatefulSet.

  • You cannot attach a PV to a standalone pod when upgrading. You should shut down the pod before upgrading the volume.

  • You can upgrade only a volume that is bound to a PVC. Volumes that are not bound to PVCs should be removed and imported before upgrading.

Volume upgrade example

Here is an example that shows how a volume upgrade is performed.

  1. Run kubectl get pv to list the PVs.

    $ 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

    There are currently four PVs that have been created by Trident 20.07, using the netapp.io/trident provisioner.

  2. Run kubectl describe pv to get the details of the 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

    The PV was created by using the netapp.io/trident provisioner and is of the type NFS. To support all the new features provided by Astra Trident, this PV should be upgraded to the CSI type.

  3. Run the tridenctl upgrade volume <name-of-trident-volume> command to upgrade a legacy Astra Trident volume to the CSI spec.

    $ ./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. Run a kubectl describe pv to verify that the volume is a CSI 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>

    In this manner, you can upgrade volumes of the NFS/iSCSI type that were created by Astra Trident to the CSI type, on a per-volume basis.