1 - Upgrading or Rolling Back Huawei CSI Using Helm

To upgrade Huawei CSI from 2.x to 4.5.0, uninstall it by referring to the user guide of the earlier version and install Huawei CSI by referring to Installing Huawei CSI Using Helm.

To upgrade Huawei CSI from 2.x or 3.x to 4.5.0, see Upgrading from 2.x or 3.x to 4.x.

To upgrade Huawei CSI from 4.x to 4.5.0, see Upgrading Huawei CSI on Kubernetes, OpenShift, and Tanzu.

1.1 - Upgrading Huawei CSI

This section describes how to upgrade Huawei CSI.

During the upgrade or rollback, the existing resources such as PVCs, snapshots, and Pods will run properly and will not affect your service access.

  • Some CSI 2.x versions are unavailable now. If the upgrade fails, CSI may fail to be rolled back to a version which is unavailable now.
  • After an upgrade from 2.x, 3.x, or 4.x to 4.5.0, a Pod that has been provisioned in the source version may fail to be mounted again. For details, see Upgrading from 2.x or 3.x to 4.x.
  • During the upgrade or rollback, you cannot use Huawei CSI to create new resources or mount or unmount an existing PVC.
  • During the upgrade or rollback, do not uninstall the snapshot-dependent component service.

1.1.1 - Upgrading from 2.x or 3.x to 4.x

In CSI 2.x or 3.x, when block storage is used, the mapping with storage is set up in the huawei-csi-node service. Therefore, the huawei-csi-node service needs to communicate with the storage management network. Because the huawei-csi-node service is deployed as a DaemonSet, the huawei-csi-node service is deployed on each node in the cluster. As a result, in a large-scale cluster, each huawei-csi-node service sends requests to the storage and the number of storage connections may be fully occupied. Accordingly, huawei-csi-node cannot provide services properly. In CSI 4.x, the deployment model is optimized. The setup of the mapping with storage is migrated to the huawei-csi-controller service and the huawei-csi-node service does not need to communicate with the storage management network. This reduces the networking complexity of Huawei CSI. In addition, the huawei-csi-controller service is deployed as a Deployment. The number of copies is set based on the customer’s reliability requirements. Generally, the number of copies ranges from 1 to 3. Therefore, the number of connections between Huawei CSI and storage is greatly reduced, so that Huawei CSI can connect to a large-scale cluster. This change may cause a problem. That is, if a new mount process is generated after CSI is upgraded to 4.x but with workloads provisioned using 2.x or 3.x and the Container Orchestration (CO) system does not invoke the huawei-csi-controller service provided by Huawei CSI, the mounting will fail. For details, see A Pod Fails to Be Created and Message “publishInfo doesn’t exist” Is Displayed in the Events Log.

Backing Up Storage Backend Configurations

If you have evaluated the risks mentioned in the preceding notice and need to upgrade CSI from 2.x or 3.x to 4.5.0, perform the following steps to back up storage backend configurations:

  1. Use a remote access tool, such as PuTTY, to log in to any master node in the Kubernetes cluster through the management IP address.

  2. Run the following command to back up the backend information to the configmap.json file. For the OpenShift platform, replace kubectl with oc.

    kubectl get cm huawei-csi-configmap -n huawei-csi -o json > configmap.json
    

Upgrading Huawei CSI

Perform the upgrade according to the procedure described in Upgrading Huawei CSI.

Configuring the Storage Backend

Configure the storage backend by following the instructions in Managing Storage Backends according to the backend information backed up in Backing Up Storage Backend Configurations. After the storage backend is successfully configured, perform operations according to the risk handling methods described in the preceding notice to prevent problems during Pod failover.

1.1.2 - Upgrading Huawei CSI on Kubernetes, OpenShift, and Tanzu

Prerequisites

  • Huawei CSI of an earlier version is installed using Helm.
  • A Huawei CSI image of a new version has been created and uploaded to the image repository or imported to all nodes by following the instructions provided in Uploading a Huawei CSI Image.

Upgrading Huawei CSI

If CSI of an earlier version is deployed using Helm, perform the following steps to upgrade Huawei CSI.

  1. Use a remote access tool, such as PuTTY, to log in to any master node in the Kubernetes cluster through the management IP address.

  2. Copy the CSI component package of the target version to any directory on the master node.

  3. Go to the helm/esdk working directory. For the directory path, see Table 1.

    cd helm/esdk
    
  4. Run the kubectl apply -f ./crds/backend/ command to update the storage backend CRD.

    kubectl apply -f ./crds/backend/
    
  5. (Optional) Check snapshot-dependent components by following the instructions provided in Checking Volume Snapshot-Dependent Components. After confirming that the components are correct, run the kubectl apply -f ./crds/snapshot-crds/ –validate=false command to update the snapshot CRD. If controller.snapshot.enabled is set to false or the Kubernetes version is earlier than v1.17, you can skip this step. For details, see Table 2.

    kubectl apply -f ./crds/snapshot-crds/ --validate=false
    
  6. Run the following command to obtain the original service configuration file. helm-huawei-csi indicates the Helm chart name specified during the installation of the earlier version, and huawei-csi indicates the Helm chart namespace specified during the installation of the earlier version.

    helm get values helm-huawei-csi -n huawei-csi -a > ./update-values.yaml
    
  7. Run the vi update-values.yaml command to open the file obtained in 6, modify the images configuration items, and update the image to the latest version. For details about the parameters to be modified, see Table 1.

    Table 1 images configuration items

    Parameter

    Description

    New Value

    images.huaweiCSIService

    huawei-csi image.

    huawei-csi:4.5.0

    images.storageBackendSidecar

    Image used by Huawei backends to manage storageBackendContent resources.

    storage-backend-sidecar:4.5.0

    images.storageBackendController

    Image used by Huawei backends to manage storageBackendClaim resources.

    storage-backend-controller:4.5.0

    images.huaweiCSIExtender

    huawei-csi-extender image.

    huawei-csi-extender:4.5.0

    images.sidecar.livenessProbe

    livenessprobe sidecar image.

    k8s.gcr.io/sig-storage/livenessprobe:v2.5.0

    images.sidecar.provisioner

    csi-provisioner sidecar image.

    k8s.gcr.io/sig-storage/csi-provisioner:v3.0.0

    images.sidecar.attacher

    csi-attacher sidecar image.

    k8s.gcr.io/sig-storage/csi-attacher:v3.4.0

    images.sidecar.resizer

    csi-resizer sidecar image.

    k8s.gcr.io/sig-storage/csi-resizer:v1.4.0

    images.sidecar.snapshotter

    csi-snapshotter sidecar image.

    k8s.gcr.io/sig-storage/csi-snapshotter:v4.2.1

    images.sidecar.snapshotController

    snapshot-controller sidecar image.

    k8s.gcr.io/sig-storage/snapshot-controller:v4.2.1

    images.sidecar.registrar

    csi-node-driver-registrar sidecar image.

    k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.3.0

  8. (Optional) If you need to update configuration items or add configuration information during the upgrade, modify the configuration information in the update-values.yaml file by referring to Parameters in the values.yaml File of Helm.

    During the upgrade, if the update-values.yaml and values.yaml configuration files contain the same configuration item, the configuration in the update-values.yaml file takes effect preferentially.

  9. Run the following command to upgrade Huawei CSI. In the following command, helm-huawei-csi indicates the specified Helm chart name, huawei-csi indicates the specified Helm chart namespace, and update-values.yaml indicates the file obtained in 6.

    helm upgrade helm-huawei-csi ./ -n huawei-csi -f ./values.yaml -f ./update-values.yaml
    
  10. After the huawei-csi service is deployed, run the following command to check whether the service is started.

    kubectl get pod -n huawei-csi
    

    The following is an example of the command output. If the Pod status is Running, the service is started successfully.

    NAME                                     READY   STATUS    RESTARTS   AGE
    huawei-csi-controller-6dfcc4b79f-9vjtq   9/9     Running   0          24m
    huawei-csi-controller-6dfcc4b79f-csphc   9/9     Running   0          24m
    huawei-csi-node-g6f4k                    3/3     Running   0          20m
    huawei-csi-node-tqs87                    3/3     Running   0          20m
    

1.1.3 - Upgrading Huawei CSI on CCE or CCE Agile

Prerequisites

You have downloaded the CSI software package of a new version.

Procedure

  1. Uninstall CSI. For details, see Uninstalling Huawei CSI on CCE or CCE Agile.
  2. Install CSI of the new version. For details, see Installing Huawei CSI on the CCE or CCE Agile Platform.

1.2 - Rolling Back Huawei CSI

If CSI fails to be upgraded from 2.x or 3.x to 4.5.0 and needs to be rolled back, uninstall CSI by referring to Uninstalling Huawei CSI Using Helm and then download and install CSI of the source version.

NOTICE:

  • During the upgrade or rollback, the existing resources such as PVCs, snapshots, and Pods will run properly and will not affect your service access.
  • During the upgrade or rollback, you cannot use Huawei CSI to create new resources or mount or unmount an existing PVC.
  • During the upgrade or rollback, do not uninstall the snapshot-dependent component service.

1.2.1 - Rolling Back Huawei CSI on Kubernetes, OpenShift, and Tanzu

Prerequisites

  • CSI has been updated using Helm 3.

Procedure

  1. Use a remote access tool, such as PuTTY, to log in to any master node in the Kubernetes cluster through the management IP address.

  2. Go to the helm/esdk working directory. For the directory path, see Table 1.

    cd helm/esdk
    
  3. Run the following command to query the historical versions of the CSI services deployed using Helm.

    helm history helm-huawei-csi -n huawei-csi 
    

    The following is an example of the command output.

    REVISION        UPDATED                         STATUS          CHART           APP VERSION     DESCRIPTION     
    1       	Mon Jan  8 04:15:40 2024	superseded	esdk-4.4.0	4.4.0      	Install complete
    2       	Mon Jan  8 04:16:12 2024	deployed  	esdk-4.5.0	4.5.0      	Upgrade complete
    
  4. Run the following command to roll back the CSI services to the specified version.

    In the preceding command, revision-number indicates a version number queried in 3. For example, the version is 1.

    helm rollback helm-huawei-csi -n huawei-csi 1
    

    The following is an example of the command output. If Rollback was a success is displayed in the command output, the CSI services are successfully rolled back to the specified version.

    Rollback was a success! Happy Helming!
    

1.2.2 - Rolling Back Huawei CSI on CCE or CCE Agile

  • During the upgrade or rollback, the existing resources such as PVCs, snapshots, and Pods will run properly and will not affect your service access.
  • During the upgrade or rollback, you cannot use Huawei CSI to create new resources or mount or unmount an existing PVC.
  • During the upgrade or rollback, do not uninstall the snapshot-dependent component service.

Prerequisites

You have downloaded the CSI software package of the source version.

Procedure

  1. Use a remote access tool, such as PuTTY, to log in to any master node in the Kubernetes cluster through the management IP address.
  2. Uninstall CSI. For details, see Procedure.
  3. Reinstall CSI of the source version. For details, see Installing Huawei CSI on the CCE or CCE Agile Platform.

2 - Manual Upgrade/Rollback

2.1 - Upgrading Huawei CSI

This section describes how to manually upgrade Huawei CSI.

During the upgrade or rollback, the existing resources such as PVCs, snapshots, and Pods will run properly and will not affect your service access.

  • Some CSI 2.x versions are unavailable now. If the upgrade fails, CSI may fail to be rolled back to a version which is unavailable now.
  • During the upgrade or rollback, you cannot use Huawei CSI to create new resources or mount or unmount an existing PVC.
  • During the upgrade or rollback, do not uninstall the snapshot-dependent component service.

Upgrading CSI from 2.x or 3.x to 4.5.0

To upgrade CSI from 2.x or 3.x to 4.5.0, perform the following operations:

  1. Use a remote access tool, such as PuTTY, to log in to any master node in the Kubernetes cluster through the management IP address.

  2. Run the following command to back up the backend information to the configmap.json file. For the OpenShift platform, replace kubectl with oc.

    kubectl get cm huawei-csi-configmap -n huawei-csi -o json > configmap.json
    
  3. Uninstall CSI. For details, see Manually Uninstalling Huawei CSI.

  4. Install CSI of the current version. For details, see Manually Installing Huawei CSI.

  5. Install the backend information backed up in 2 according to Managing Storage Backends.

Upgrading CSI from 4.x to 4.5.0

To upgrade CSI from 4.x to 4.5.0, perform the following operations:

  1. Use a remote access tool, such as PuTTY, to log in to any master node in the Kubernetes cluster through the management IP address.
  2. Uninstall CSI. For details, see Manually Uninstalling Huawei CSI.
  3. Install CSI of the current version. For details, see Manually Installing Huawei CSI.

2.2 - Rolling Back Huawei CSI

Uninstall CSI by referring to Manually Uninstalling Huawei CSI, and then download and install CSI of the source version.

  • During the upgrade or rollback, the existing resources such as PVCs, snapshots, and Pods will run properly and will not affect your service access.
  • During the upgrade or rollback, you cannot use Huawei CSI to create new resources or mount or unmount an existing PVC.
  • During the upgrade or rollback, do not uninstall the snapshot-dependent component service.

Prerequisites

You have downloaded the CSI software package of the source version.

Procedure

  1. Use a remote access tool, such as PuTTY, to log in to any master node in the Kubernetes cluster through the management IP address.
  2. Uninstall CSI. For details, see Manually Uninstalling Huawei CSI.
  3. Reinstall CSI of the source version. For details, see Manually Installing Huawei CSI.