Manually Uninstalling Huawei CSI

This section describes how to manually uninstall Huawei CSI.

If you do not uninstall Huawei CSI for the purpose of an upgrade, ensure that all resources (such as PV, PVC, snapshot, and storage backend resources) provisioned by Huawei CSI have been cleared on your container platform before uninstalling Huawei CSI. Otherwise, once you uninstall Huawei CSI, these resources cannot be automatically scheduled, managed, or cleared.

Uninstalling the huawei-csi-node Service

  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 uninstall the huawei-csi-node service. Replace huawei-csi with the namespace where Huawei CSI is located.

    kubectl delete daemonset huawei-csi-node -n huawei-csi
    
  3. Run the following command to check whether the service is successfully uninstalled. If NotFound is displayed, the service is successfully uninstalled.

    kubectl get daemonset huawei-csi-node -n huawei-csi
    

Uninstalling the huawei-csi-controller Service

  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 uninstall the huawei-csi-controller service. Replace huawei-csi with the namespace where Huawei CSI is located.

    kubectl delete deployment huawei-csi-controller -n huawei-csi
    
  3. Run the following command to check whether the service is successfully uninstalled. If NotFound is displayed, the service is successfully uninstalled.

    kubectl get deployment huawei-csi-controller -n huawei-csi
    

Uninstalling the csidriver Object

If the CSIDriver feature is not used during installation, you can skip the following steps.

  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 uninstall the csidriver object.

    kubectl delete csidriver csi.huawei.com
    
  3. Run the following command to check whether the service is successfully uninstalled. If NotFound is displayed, the service is successfully uninstalled.

    kubectl get csidriver csi.huawei.com
    

Deleting the RBAC Permission

  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. Delete the RBAC permission.

    kubectl -n huawei-csi -l provisioner=csi.huawei.com delete ServiceAccount,Service,role,rolebinding,ClusterRole,ClusterRoleBinding
    

Uninstalling Other Resources

  1. Uninstall the huawei-csi-host-info object. For details, see Uninstalling the huawei-csi-host-info Object.
  2. Uninstall the webhook resource. For details, see Uninstalling a Webhook Resource.
  3. (Optional) Uninstall the snapshot-dependent component service. For details, see Uninstalling the Snapshot-Dependent Component Service.
  4. (Optional) Uninstall the Lease resource. For details, see Uninstalling a Lease Resource.