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