Graceful uninstallation of OpenEBS can be carried out using the below-mentioned steps:
Deletion of application pods
Ensure that all the application pods deployed on OpenEBS volumes are deleted. To verify the status of application pods use the following command:
kubectl get pods -n <namespace_of_application>
Deletion of associated PVCs and PVs
Ensure that OpenEBS PVCs and PVs are deleted. To view PV, execute:
kubectl get pv
The below mentioned command displays all the PVCs in the namespace, hence, while deleting ensure that PVCs associated with only OpenEBS are deleted. You can check the status of PVC using the following command.
kubectl get pvc -n <namespace_of_application>
If the Storage Engine used is cStor, ensure that no cStor volume replicas (CVR) and cStor volumes are present. To view the list of CVR execute the following command:
kubectl get cvr -n <openebs_namespace>
Deletion of CSPs or scrub jobs according to the Storage Engine used
Deletion of BDC
In case of cStor, once the pools are deleted ensure the corresponding BDCs are also deleted and the related blockdevices must be in an unclaimed state.
In case of LocalPV device, after deletion of application the corresponding BDCs must be deleted and state of blockdevice must be unclaimed.
Ensure that no OpenEBS target or cStor pool pods are in terminating state. To check pod status execute the following command:
kubectl get pods -n <openebs_namespace>
Delete OpenEBS StorageClass
Ensure to delete OpenEBS related StorageClass. You can check the status of OpenEBS related StorageClasses using the following command.
kubectl get sc
Delete OpenEBS namespace
OpenEBS namespace can be deleted in the following ways:
- Using helm:
helm delete <chart_name> --purge
- By deleting the operator YAML:
Delete the corresponding operator YAML. Execute:
kubectl delete -f <openebs_operator.yaml>
To verify, execute:
kubectl get ns
Delete the CRDs
Uninstalling OpenEBS doesn't automatically delete the CRDs that were created. In order to completely remove the CRDs and associated objects, execute the following command:
kubectl delete crd castemplates.openebs.io kubectl delete crd cstorpools.openebs.io kubectl delete crd cstorpoolinstances.openebs.io kubectl delete crd cstorvolumeclaims.openebs.io kubectl delete crd cstorvolumereplicas.openebs.io kubectl delete crd cstorvolumes.openebs.io kubectl delete crd runtasks.openebs.io kubectl delete crd storagepoolclaims.openebs.io kubectl delete crd storagepools.openebs.io kubectl delete crd volumesnapshotdatas.volumesnapshot.external-storage.k8s.io kubectl delete crd volumesnapshots.volumesnapshot.external-storage.k8s.io kubectl delete crd disks.openebs.io kubectl delete crd blockdevices.openebs.io kubectl delete crd blockdeviceclaims.openebs.io kubectl delete crd cstorbackups.openebs.io kubectl delete crd cstorrestores.openebs.io kubectl delete crd cstorcompletedbackups.openebs.io kubectl delete crd cstorpoolclusters.openebs.io kubectl delete crd upgradetasks.openebs.io