Skip to main content
A newer release of this product is available.

Upgrade with the operator

Contributors juliantap

You can easily upgrade an existing Astra Trident installation using the operator either manually or using Helm.

Upgrade using the Trident operator

Generally, you should upgrade Astra Trident using the same method that was used to originally install it. Review Select an upgrade method before attempting to upgrade with the Trident operator.

Important

When upgrading from an instance of Astra Trident installed using the namespace-scoped operator (versions 20.07 through 20.10), the Trident operator automatically:

  • Migrates tridentProvisioner to a tridentOrchestrator object with the same name,

  • Deletes TridentProvisioner objects and the tridentprovisioner CRD

  • Upgrades Astra Trident to the version of the cluster-scoped operator being used

  • Install Astra Trident same namespace where it was originally installed

Upgrade a cluster-scoped Trident operator installation

You can upgrade a cluster-scoped Trident operator installation. All Astra Trident versions 21.01 and above use a cluster-scoped operator.

Before you begin

Ensure you are using a Kubernetes cluster running a supported Kubernetes version.

Steps
  1. Verify your Astra Trident version:

    ./tridentctl -n trident version
  2. Delete the Trident operator that was used to install the current Astra Trident instance. For example, if you are upgrading from 22.01, run the following command:

    kubectl delete -f 22.01/trident-installer/deploy/bundle.yaml -n trident
  3. If you customized your initial installation using TridentOrchestrator attributes, you can edit the TridentOrchestrator object to modify the installation parameters. This might include changes made to specify mirrored Trident and CSI image registries for offline mode, enable debug logs, or specify image pull secrets.

  4. Install Astra Trident using the correct bundle YAML file for your environment and Astra Trident version. For example, if you are installing Astra Trident 23.04 for Kubernetes 1.27, run the following command:

    kubectl create -f 23.04.0/trident-installer/deploy/bundle_post_1_25.yaml -n trident
    Note

    Trident provides a bundle file that can be used to install the operator and create associated objects for your Kubernetes version.

Results

The Trident operator will identify an existing Astra Trident installation and upgrade it to the same version as the operator.

Upgrade a namespace-scoped operator installation

You can upgrade from an instance of Astra Trident installed using the namespace-scoped operator (versions 20.07 through 20.10) to a cluster-scoped operator installation.

Before you begin

You need the bundle YAML file used to deploy the namespace-scoped operator from https://github.com/NetApp/trident/tree/stable/vXX.XX/deploy/BUNDLE.YAML where vXX.XX is the version number and BUNDLE.YAML is the bundle YAML file name.

Steps
  1. Verify the TridentProvisioner status of the existing Trident installation is Installed.

    kubectl describe tprov trident -n trident | grep Message: -A 3
    
    Message:  Trident installed
    Status:   Installed
    Version:  v20.10.1
    Note If status shows Updating, ensure you resolve it before proceeding. For a list of possible status values, see here.
  2. Create the TridentOrchestrator CRD by using the manifest provided with the Trident installer.

    # Download the release required [23.04.0]
    mkdir 23.04.0
    cd 23.04.0
    wget https://github.com/NetApp/trident/releases/download/v23.04.0/trident-installer-23.04.0.tar.gz
    tar -xf trident-installer-23.04.0.tar.gz
    cd trident-installer
    kubectl create -f deploy/crds/trident.netapp.io_tridentorchestrators_crd_post1.16.yaml
  3. Delete the namespace-scoped operator by using its manifest.

    1. Ensure you are in the right directory.

      pwd
      /root/20.10.1/trident-installer
    2. Delete the namespace-scoped operator.

      kubectl delete -f deploy/<BUNDLE.YAML> -n trident
      
      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
    3. 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
  4. (Optional) If the install parameters need to be modified, update the TridentProvisioner spec. This can include changes such as changing: the values for tridentImage, autosupportImage, private image repository, and providing imagePullSecrets) after deleting the namespace-scoped operator and before installing the cluster-scoped operator. For a complete list of parameters that can be updated, refer to the configuration options.

    kubectl patch tprov <trident-provisioner-name> -n <trident-namespace> --type=merge -p '{"spec":{"debug":true}}'
  5. Install the Trident cluster-scoped operator.

    1. Ensure you are in the correct directory.

      pwd
      /root/23.04.0/trident-installer
    2. Install the cluster-scoped operator in the same namespace.

      Note

      Trident provides a bundle file that can be used to install the operator and create associated objects for your Kubernetes version.

      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
    3. Examine the Trident pods in the namespace. The trident-controller and pod names reflect the naming convention introduced in 23.01.

      kubectl get pods -n trident
      
      NAME                                     READY   STATUS    RESTARTS   AGE
      trident-controller-79df798bdc-m79dc      6/6     Running   0          1m41s
      trident-node-linux-xrst8                 2/2     Running   0          1m41s
      trident-operator-5574dbbc68-nthjv        1/1     Running   0          1m52s
    4. Confirm Trident has been updated to the intended version.

      kubectl describe torc trident | grep Message -A 3
      Message:                Trident installed
      Namespace:              trident
      Status:                 Installed
      Version:                v23.04.0

Upgrade a Helm-based operator installation

Perform the following steps to upgrade a Helm-based operator installation.

Warning When upgrading a Kubernetes cluster from 1.24 to 1.25 or later that has Astra Trident installed, you must update values.yaml to set excludePodSecurityPolicy to true or add --set excludePodSecurityPolicy=true to the helm upgrade command before you can upgrade the cluster.
Steps
  1. Download the latest Astra Trident release.

  2. Use the helm upgrade command where trident-operator-23.04.0.tgz reflects the version that you want to upgrade to.

    helm upgrade <name> trident-operator-23.04.0.tgz
    Note

    If you set any non-default options during the initial installation (such as specifying private, mirrored registries for Trident and CSI images), use --set to ensure those options are included in the upgrade command, otherwise the values will reset to default.

    For example, to change the default value of tridentDebug, run the following command:

    helm upgrade <name> trident-operator-23.04.0-custom.tgz --set tridentDebug=true
  3. Run helm list to verify that the chart and app version have both been upgraded. Run tridentctl logs to review any debug messages.

Results

The Trident operator will identify an existing Astra Trident installation and upgrade it to the same version as the operator.

Upgrade from a non-operator installation

You can upgrade to the latest release of the Trident operator from a tridentctl installation.

Steps
  1. Download the latest Astra Trident release.

    # Download the release required [23.04.0]
    mkdir 23.04.0
    cd 23.04.0
    wget https://github.com/NetApp/trident/releases/download/v22.01.1/trident-installer-23.04.0.tar.gz
    tar -xf trident-installer-23.04.0.tar.gz
    cd trident-installer
  2. Create the tridentorchestrator CRD from the manifest.

    kubectl create -f deploy/crds/trident.netapp.io_tridentorchestrators_crd_post1.16.yaml
  3. Deploy 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-controller-79df798bdc-m79dc   6/6     Running   0          150d
    trident-node-linux-xrst8              2/2     Running   0          150d
    trident-operator-5574dbbc68-nthjv     1/1     Running   0          1m30s
  4. Create a TridentOrchestrator CR for installing Astra Trident.

    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
  5. Confirm Trident was upgraded to the intended version.

    kubectl describe torc trident | grep Message -A 3
    
    Message:                Trident installed
    Namespace:              trident
    Status:                 Installed
    Version:                v23.04.0
Results

The existing backends and PVCs are automatically available.