Uninstalling the Operator

Uninstall the Operator online includes deleting parameters such as custom resource definitions, subscription, webhook service, which were created during Operator installation.

About this task

Choose from any of the following methods to uninstall the Operator.

Procedure

  • Uninstalling the Operator in the Red Hat OpenShift Container Platform web console. The following steps apply only to installations that used OLM.
    1. From the context selector in the navigation menu, click Operators > Installed Operators. A page that lists all the installed Operators opens.
    2. From Project, select the namespace where the Operator is installed.
    3. Click the three-dot icon next to the Operator that you want to uninstall, and select Uninstall Operator.
    4. Confirm the uninstallation message to remove the Operator from the cluster.
    5. Go to Administration > CustomResourceDefinitions in the navigation menu.

      The list of custom resource definitions is displayed.

    6. In the search bar, type apps.oms.ibm.com to filter the CRDs created by the Operator.
    7. Locate and delete the following CRDs that the Operator created during installation.
      • CallCenter
      • OMEnvironment
      • OMServer
      • OrderHub
      • OrderService
  • Uninstalling the Operator by using the oc command-line tool.

    Follow steps 1 to 3, only to installations that used OLM. Follow steps 1 to 8 for installations that did not use OLM.

    1. Delete the ClusterService version by running the following command.
      oc delete csv <subscription_name>.<channel> -n <namespace>
    2. Delete the subscription by running the following command. Replace <subscription_name>with the name of your subscription and <namespace> with the namespace where it was created.
      oc delete sub <subscription_name> -n <namespace>
    3. Delete the Custom Resource Definitions (CRDs).
      oc delete crd callcenters.apps.oms.ibm.com \
                    omenvironments.apps.oms.ibm.com \
                    omservers.apps.oms.ibm.com \
                    orderhubs.apps.oms.ibm.com \
                    orderservices.apps.oms.ibm.com
    4. Continue with steps 5 to 8 only if you installed without OLM.
    5. Export the namespace where the OMS Operator is installed.
      export INSTALL_NAMESPACE="oms"
    6. Remove the service certificate secret.
      oc delete secret ibm-oms-controller-manager-service-cert -n $INSTALL_NAMESPACE
    7. Delete the webhook service.
      oc delete svc oms-webhook-service -n $INSTALL_NAMESPACE
    8. Remove both the mutating and validating webhook configurations.
      oc delete MutatingWebhookConfiguration oms-mutating-webhook-configuration -n $INSTALL_NAMESPACE
      oc delete ValidatingWebhookConfiguration oms-validating-webhook-configuration -n $INSTALL_NAMESPACE
  • Uninstalling with the Operator Utility script

    The op_util script ensures a clean removal of all associated resources within the specified namespace.

    1. Familiarize yourself with the information about Operator Utility script. For more information, see Operator Utility overview.
    2. Download the Operator Utility script from the following repositories.
    3. Use the following uninstall command to remove the required Operator from the target Kubernetes environment.
      op_util uninstall <product> [Options]
      1. Use any of the following values for <product> based on the Operator that you want to uninstall.
        • oms for IBM Sterling Order Management System Operator
        • sip for IBM Sterling Intelligent Promising Operator
        • oms-gateway for IBM OMS Gateway Operator
      2. Define the options from the following list.
        --namespace NAMESPACE
        Specify the Kubernetes namespace where the Operator should be uninstalled. It defaults to the current Kubernetes context namespace.
        --force
        Specify to force the uninstallation of the Operator, even if dependencies exist. Hence, use this option with caution.
      3. Refer to the following examples.
        • Example 1: Uninstalling IBM Sterling Order Management System Operator from the current namespace
          op_util uninstall oms
        • Example 2: Uninstalling IBM Sterling Intelligent Promising Operator from a specific namespace
          op_util uninstall sip --namespace custom-namespace