Bug 2251308 - Unable to uninstall ocs-client-operator
Summary: Unable to uninstall ocs-client-operator
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenShift Data Foundation
Classification: Red Hat Storage
Component: ocs-client-operator
Version: 4.14
Hardware: Unspecified
OS: Unspecified
low
high
Target Milestone: ---
: ODF 4.16.0
Assignee: aberner
QA Contact: Jilju Joy
URL:
Whiteboard: isf-provider
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-11-24 07:22 UTC by Rewant
Modified: 2024-11-15 04:25 UTC (History)
9 users (show)

Fixed In Version: 4.16.0-84
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2024-07-17 13:11:40 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github red-hat-storage ocs-client-operator pull 64 0 None open Bug 2251308: Redesign for ClusterVersion controller into OperatorConfigMap controller 2024-01-29 10:57:17 UTC
Red Hat Product Errata RHSA-2024:4591 0 None None None 2024-07-17 13:11:44 UTC

Description Rewant 2023-11-24 07:22:54 UTC
Description of problem:

OCS Client Operator cannot be completely uninstalled. The deployments and daemonset for CSI fs and rbd remain.

Version-Release number of selected component (if applicable):
4.14.1

How reproducible:
100%

Steps to Reproduce:
Followed the following steps to uninstall the operator
1. Delete the storageClassClaims
2. Delete the storageClients
3. Delete the subs for OCS-client
4. Delete the subs for CSI-addons
5. Delete the csv for OCS-client
6. Delete the csv for CSI-addons

Actual results:
Deployments/daemonsets/csiaddonsnode are not deleted 

Expected results:
CSI rbd and fs deployments, daemonsets and rbd csiaddonsnode are deleted 


Additional info:

Comment 2 Rewant 2023-12-05 11:45:06 UTC
The workaround is:

Followed the following steps to uninstall the operator
1. Make sure that all the PV/PVCs using the storageClass from this client is deleted
2. Delete the storageClassClaims
3. Delete the storageClients
4. Delete the SUBS for OCS-client and CSI-addons
5. Delete the CSV for OCS-client and CSI-addons
6. Remove the finalizers from the csiaddonsnode
7. Delete all the deployments/daemonsets

Comment 3 aberner 2023-12-10 17:42:44 UTC
After a full investigation i've come to the conclusions below,
1. The controller in charge of deploying the leftover components does not have a deletion phase.
2. After discussion with the csi team uninstall of components should be as simple as their removal
3. Fix will be created accordingly, deletion phase will be added to the controller which will remove the leftover components.

Comment 4 aberner 2024-01-08 10:29:15 UTC
after further discussion and investigation a correction need to be made,
clusterversion controller is currently a controller watching the clusterversion resource in the ocp deployment hence the resource wont be deleted and so does the leftover resources of said controller. that said we decided to change the approach and redesign the controller to watch a configmap instead, the config map will sit under the namespace and when the namespace will be deleted so will the resources.

Comment 8 Rewant 2024-01-25 07:27:25 UTC
@nberry To delete an operator from the CLI we need to delete the subs followed by the CSV [1].

Removing the namespace directly will lead to some resources remaining and we would need to remove the finalizers which is not a clean uninstall.

[1]:https://docs.openshift.com/container-platform/4.14/operators/admin/olm-deleting-operators-from-cluster.html#olm-deleting-operator-from-a-cluster-using-cli_olm-deleting-operators-from-a-cluster

Comment 17 suchita 2024-05-15 05:16:37 UTC
I followed the Steps to Reproduce as mentioned in BZ description:


-------------------------------------------------------
Followed the following steps to uninstall the operator
1. Delete the storageClassClaims
2. Delete the storageClients
3. Delete the subs for OCS-client
4. Delete the subs for CSI-addons
5. Delete the csv for OCS-client
6. Delete the csv for CSI-addons
--------------------Execution-----------------------------------
$ oc project openshift-storage-client
Now using project "openshift-storage-client" on server "https://52.118.6.141:6443"
1.1. Ensure no pv/PVCs
$oc get pv
No resources found

$ oc get pvc
No resources found

1.2 Delete the storageClassClaims
$ oc get storageclaims
NAME                      STORAGETYPE   STORAGEPROFILE   STORAGECLIENTNAME   PHASE
storage-client-ceph-rbd   block                          storage-client      Ready
storage-client-cephfs     sharedfile                     storage-client      Ready

oc delete storageclaims storage-client-ceph-rbd storage-client-cephfs
storageclaim.ocs.openshift.io "storage-client-ceph-rbd" deleted
storageclaim.ocs.openshift.io "storage-client-cephfs" deleted

$ oc get storageclaims
No resources found

2. Delete the storageClients
$ oc get storageclient
NAME             PHASE       CONSUMER
storage-client   Connected   d84f9401-368e-4b3d-8172-e06d642f39e3
sgatfane-mac:Clusters sgatfane$ oc delete storageclient storage-client
storageclient.ocs.openshift.io "storage-client" deleted

3. Delete the subs for OCS-client
$ oc get subs
NAME                                                                         PACKAGE                   SOURCE              CHANNEL
ocs-client-operator                                                          ocs-client-operator       ocs-catalogsource   stable-4.16
odf-csi-addons-operator-stable-4.15-redhat-operators-openshift-marketplace   odf-csi-addons-operator   redhat-operators    stable-4.15

$ oc delete subs ocs-client-operator
subscription.operators.coreos.com "ocs-client-operator" deleted

4. Delete the subs for CSI-addons
$ oc delete subs odf-csi-addons-operator-stable-4.15-redhat-operators-openshift-marketplace
subscription.operators.coreos.com "odf-csi-addons-operator-stable-4.15-redhat-operators-openshift-marketplace" deleted

$ oc get subs
No resources found in openshift-storage-client namespace.

5. Delete the csv for OCS-client
$ oc get csv
NAME                                    DISPLAY                            VERSION            REPLACES                                PHASE
ocs-client-operator.v4.16.0-86.stable   OpenShift Data Foundation Client   4.16.0-86.stable                                           Succeeded
odf-csi-addons-operator.v4.15.2-rhodf   CSI Addons                         4.15.2-rhodf       odf-csi-addons-operator.v4.15.1-rhodf   Succeeded

$ oc delete csv ocs-client-operator.v4.16.0-86.stable
clusterserviceversion.operators.coreos.com "ocs-client-operator.v4.16.0-86.stable" deleted
$ oc delete csv odf-csi-addons-operator.v4.15.2-rhodf

6. Delete the csv for CSI-addons
clusterserviceversion.operators.coreos.com "odf-csi-addons-operator.v4.15.2-rhodf" deleted

$ oc get csv
No resources found in openshift-storage-client namespace.

-------Observations------------------------------
$ oc get deployments
NAME                           READY   UP-TO-DATE   AVAILABLE   AGE
csi-cephfsplugin-provisioner   2/2     2            2           13d
csi-rbdplugin-provisioner      2/2     2            2           13d

$ oc get daemonsets
NAME               DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE
csi-cephfsplugin   3         3         3       3            3           <none>          13d
csi-rbdplugin      3         3         3       3            3           <none>          13d

$ oc get csiaddonsnode
NAME                                         NAMESPACE                  AGE     DRIVERNAME                           ENDPOINT                                                                         NODEID
csi-rbdplugin-8jg98                          openshift-storage-client   13d     openshift-storage.rbd.csi.ceph.com   pod://csi-rbdplugin-8jg98.openshift-storage-client:9070                          hcp416-bm1-y-c749275d-p4gc9
csi-rbdplugin-provisioner-7fc4b46b95-7krth   openshift-storage-client   5d21h   openshift-storage.rbd.csi.ceph.com   pod://csi-rbdplugin-provisioner-7fc4b46b95-7krth.openshift-storage-client:9070   hcp416-bm1-y-c749275d-2vz2c
csi-rbdplugin-provisioner-7fc4b46b95-pknxw   openshift-storage-client   5d21h   openshift-storage.rbd.csi.ceph.com   pod://csi-rbdplugin-provisioner-7fc4b46b95-pknxw.openshift-storage-client:9070   hcp416-bm1-y-c749275d-8zvlh
csi-rbdplugin-v74md                          openshift-storage-client   6d14h   openshift-storage.rbd.csi.ceph.com   pod://csi-rbdplugin-v74md.openshift-storage-client:9070                          hcp416-bm1-y-c749275d-8zvlh
csi-rbdplugin-wksql                          openshift-storage-client   13d     openshift-storage.rbd.csi.ceph.com   pod://csi-rbdplugin-wksql.openshift-storage-client:9070                          hcp416-bm1-y-c749275d-2vz2c


after following mention uninstallation steps:  
Deployments/daemonsets/csiaddonsnode are not deleted

Comment 18 suchita 2024-05-15 06:29:58 UTC
Please propose the final sequential steps of uninstallation which is supposed to follow ideally to resolve this BZ.

Comment 19 Leela Venkaiah Gangavarapu 2024-05-16 11:01:08 UTC
(In reply to suchita from comment #18)
> Please propose the final sequential steps of uninstallation which is
> supposed to follow ideally to resolve this BZ.

1. Delete all in use PV(C)s created from claimed storageclasses
2. Delete manually created storageclaims
3. Delete the storageclients
4. Delete "ocs-client-operator-config" config map (CM) in namespace where client-operator is running
5. Delete the subs for csi-addons & ocs-client-op
6. Delete the csv for csi-addons & ocs-client-op

HTH.

Comment 23 Jilju Joy 2024-05-28 16:06:04 UTC
Created a new bug https://bugzilla.redhat.com/show_bug.cgi?id=2283653.

Moving this bug to verified state. Deployments, daemonsets, csiaddonsnodes are removed. Client operator is not showing as installed in UI "Installed Operators" page.

Comment 24 Sunil Kumar Acharya 2024-06-18 06:45:26 UTC
Please update the RDT flag/text appropriately.

Comment 26 errata-xmlrpc 2024-07-17 13:11:40 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: Red Hat OpenShift Data Foundation 4.16.0 security, enhancement & bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2024:4591

Comment 27 Red Hat Bugzilla 2024-11-15 04:25:12 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days


Note You need to log in before you can comment on or make changes to this bug.