Bootstrap FreeKB - OpenShift - Uninstall Operators
OpenShift - Uninstall Operators

Updated:   |  OpenShift articles

If you are not familiar with the oc command, refer to OpenShift - Getting Started with the oc command.

The oc get operators command can be used to listed the installed Operators.

~]# oc get operators
NAME                                                AGE
cluster-logging.openshift-logging                   2y147d
elasticsearch-operator.openshift-operators-redhat   2y147d
jaeger-product.openshift-operators                  2y68d
kiali-ossm.openshift-operators                      2y68d
servicemeshoperator.openshift-operators             2y68d

 

Let's say you want to uninstall the Service Mesh Operator. Use the oc get subscription command to determine if there are any subscriptions to the Operator.

oc get subscription servicemeshoperator --namespace openshift-operators --output yaml

 

If there is an Operator Subscription, something like this should be returned in the output YAML.

currentCSV: servicemesh-operator.v1.8.2

 

If there is an Operator Subscription, use the oc delete subscription command to remove the subscription.

oc delete subscription servicemeshoperator --namespace openshift-operators

 

And then use the oc delete clusterserviceversion command.

oc delete clusterserviceversion servicemesh-operator.v1.8.2 --namespace openshift-operators

 

You may need to also use the oc get customresourcedefinitions command to return the Custom Resource Definitions associated with the Operator.

~]# oc get customresourcedefinitions | egrep -i 'istio|jaegar|kiali|maistra|servicemesh'
kialis.kiali.io                                                   2021-04-15T20:01:30Z
monitoringdashboards.monitoring.kiali.io                          2021-04-15T20:01:30Z
servicemeshextensions.maistra.io                                  2021-04-15T20:09:13Z
servicemeshmemberrolls.maistra.io                                 2021-04-15T20:02:49Z
servicemeshmembers.maistra.io                                     2021-04-15T20:02:49Z
servicemeshpolicies.authentication.maistra.io                     2021-04-15T20:09:13Z
servicemeshrbacconfigs.rbac.maistra.io                            2021-04-15T20:09:13Z

 

And then use the oc delete customresourcedefinition command to delete the Custom Resource Definitions.

oc delete crd kialis.kiali.io
oc delete crd monitoringdashboards.monitoring.kiali.io
oc delete crd servicemeshextensions.maistra.io
oc delete crd servicemeshmemberrolls.maistra.io
oc delete crd servicemeshmembers.maistra.io
oc delete crd servicemeshpolicies.authentication.maistra.io
oc delete crd servicemeshrbacconfigs.rbac.maistra.io

 

And then re-issue the oc get customresourcedefinitions command to ensure the Custom Resource Definitions were deleted. No results should be returned.

oc get customresourcedefinitions | egrep -i 'istio|kiali|maistra|servicemesh'

 

And then finally use the oc delete operator command to uninstall the Operator.

oc delete operator servicemeshoperator.openshift-operators

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 26d558 in the box below so that we can be sure you are a human.