Upgrade with the operator
You can easily upgrade an existing Astra Trident installation by using the operator.
To upgrade by using the operator, the following conditions should be met:
-
You should have a CSI-based Astra Trident installation. To check if you are running CSI Trident, examine the pods in your Trident namespace. If they follow the
trident-csi-*
naming pattern, you are running CSI Trident. -
You should have a CRD-based Trident installation. This represents all releases from 19.07 and later. If you have a CSI-based installation, you most likely have a CRD-based installation.
-
If you have uninstalled CSI Trident and the metadata from the installation persists, you can upgrade by using the operator.
-
Only one Astra Trident installation should exist across all the namespaces in a given Kubernetes cluster.
-
You should be using a Kubernetes cluster that runs version 1.17 and later.
-
If alpha snapshot CRDs are present, you should remove them with
tridentctl obliviate alpha-snapshot-crd
. This deletes the CRDs for the alpha snapshot spec. For existing snapshots that should be deleted/migrated, see this blog.
When upgrading Trident by using the operator on OpenShift Container Platform, you should upgrade to Trident 21.01.1 or later. The Trident operator released with 21.01.0 contains a known issue that has been fixed in 21.01.1. For more details, see the issue details on GitHub. |
Upgrade a cluster-scoped operator installation
To upgrade from Trident 21.01 and later, here is the set of steps to be followed.
-
Delete the Trident operator that was used to install the current Astra Trident instance. For example, if you are upgrading from 21.01, run the following command:
kubectl delete -f 21.01/trident-installer/deploy/bundle.yaml -n trident
-
(Optional) If you want to modify the installation parameters, edit the
TridentOrchestrator
object that you crated when installing Trident.
These could be changes, such as modifying the custom Trident image, private image registry to pull container images from, enabling debug logs, or specifying image pull secrets. -
Install Astra Trident by using the
bundle.yaml
file that sets up the Trident operator for the new version. Run the following command:kubectl install -f 21.07.1/trident-installer/deploy/bundle.yaml -n trident
As part of this step, the 21.07.1 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
To upgrade from an instance of Astra Trident installed using the namespace-scoped operator (versions 20.07 through 20.10), here is the set of steps to be followed:
-
Verify the status of the existing Trident installation. To do this, check the Status of
TridentProvisioner
. The status should beInstalled
.$ kubectl describe tprov trident -n trident | grep Message: -A 3 Message: Trident installed Status: Installed Version: v20.10.1
If the status shows Updating
, ensure that you resolve it before proceeding. For a list of possible status values, see here. -
Create the
TridentOrchestrator
CRD by using the manifest provided with the Trident installer.# 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
-
Delete the namespace-scoped operator by using its manifest. To complete this step, you require the
bundle.yaml
file used to deploy the namespace-scoped operator. You can obtainbundle.yaml
from the Trident repository. Make sure to use the appropriate branch.You should make the necessary changes to the Trident install parameters (for example, changing the values for tridentImage
,autosupportImage
, private image repository, and providingimagePullSecrets
) after deleting the namespace-scoped operator and before installing the cluster-scoped operator. For a complete list of parameters that can be updated, see the list of parameters.#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
At this stage, the
trident-operator-xxxxxxxxxx-xxxxx
pod is deleted. -
(Optional) If the install parameters need to be modified, update the
TridentProvisioner
spec. These could be changes such as modifying the private image registry to pull container images from, enabling debug logs, or specifying image pull secrets.$ kubectl patch tprov <trident-provisioner-name> -n <trident-namespace> --type=merge -p '{"spec":{"debug":true}}'
-
Install the cluster-scoped operator.
Installing the cluster-scoped operator initiates the migration of TridentProvisioner
objects toTridentOrchestrator
objects, deletesTridentProvisioner
objects and thetridentprovisioner
CRD, and upgrades Astra Trident to the version of the cluster-scoped operator being used. In the example that follows, Trident is upgraded to 21.07.1.Upgrading Astra Trident by using the cluster-scoped operator results in the migration of tridentProvisioner
to atridentOrchestrator
object with the same name. This is automatically handled by the operator. The upgrade will also have Astra Trident installed in the same namespace as before.#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
Upgrade a Helm-based operator installation
Perform the following steps to upgrade a Helm-based operator installation.
-
Download the latest Astra Trident release.
-
Use the
helm upgrade
command. See the following example:$ helm upgrade <name> trident-operator-21.07.1.tgz
where
trident-operator-21.07.1.tgz
reflects the version that you want to upgrade to. -
Run
helm list
to verify that the chart and app version have both been upgraded.
To pass configuration data during the upgrade, use --set .
|
For example, to change the default value of tridentDebug
, run the following command:
$ helm upgrade <name> trident-operator-21.07.1-custom.tgz --set tridentDebug=true
If you run $ tridentctl logs
, you can see the debug messages.
If you set any non-default options during the initial installation, ensure that the options are included in the upgrade command, or else, the values will be reset to their defaults. |
Upgrade from a non-operator installation
If you have a CSI Trident instance that meets the prerequisites listed above, you can upgrade to the latest release of the Trident operator.
-
Download the latest Astra Trident release.
# 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
-
Create the
tridentorchestrator
CRD from the manifest.$ kubectl create -f deploy/crds/trident.netapp.io_tridentorchestrators_crd_post1.16.yaml
-
Deploy the operator.
#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
-
Create a
TridentOrchestrator
CR for installing 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
The existing backends and PVCs are automatically available.