×

Uninstalling the logging subsystem

You can stop log aggregation by deleting the ClusterLogging custom resource (CR). After deleting the CR, there are other logging subsystem components that remain, which you can optionally remove.

Deleting the ClusterLogging CR does not remove the persistent volume claims (PVCs). To preserve or delete the remaining PVCs, persistent volumes (PVs), and associated data, you must take further action.

Prerequisites
  • The Red Hat OpenShift Logging Operator and Elasticsearch Operator are installed.

Procedure
  1. Use the OKD web console to remove the ClusterLogging CR:

    1. Switch to the AdministrationCustom Resource Definitions page.

    2. On the Custom Resource Definitions page, click ClusterLogging.

    3. On the Custom Resource Definition Details page, click Instances.

    4. Click the Options menu kebab next to the instance and select Delete ClusterLogging.

  2. Optional: Delete the custom resource definitions (CRD):

    1. Switch to the AdministrationCustom Resource Definitions page.

    2. Click the Options menu kebab next to ClusterLogForwarder and select Delete Custom Resource Definition.

    3. Click the Options menu kebab next to ClusterLogging and select Delete Custom Resource Definition.

    4. Click the Options menu kebab next to Elasticsearch and select Delete Custom Resource Definition.

  3. Optional: Remove the Red Hat OpenShift Logging Operator and Elasticsearch Operator:

    1. Switch to the OperatorsInstalled Operators page.

    2. Click the Options menu kebab next to the Red Hat OpenShift Logging Operator and select Uninstall Operator.

    3. Click the Options menu kebab next to the Elasticsearch Operator and select Uninstall Operator.

  4. Optional: Remove the openshift-logging and openshift-operators-redhat projects.

    Do not delete the openshift-operators-redhat project if other global Operators are installed in this namespace.

    1. Switch to the HomeProjects page.

    2. Click the Options menu kebab next to the openshift-logging project and select Delete Project.

    3. Confirm the deletion by typing openshift-logging in the dialog box and click Delete.

    4. Click the Options menu kebab next to the openshift-operators-redhat project and select Delete Project.

    5. Confirm the deletion by typing openshift-operators-redhat in the dialog box and click Delete.

  5. To keep the PVCs for reuse with other pods, keep the labels or PVC names that you need to reclaim the PVCs.

  6. Optional: If you do not want to keep the PVCs, you can delete them.

    Releasing or deleting PVCs can delete PVs and cause data loss.

    1. Switch to the StoragePersistent Volume Claims page.

    2. Click the Options menu kebab next to each PVC and select Delete Persistent Volume Claim.

    3. If you want to recover storage space, you can delete the PVs.

Deleting Operators from a cluster using the web console

Cluster administrators can delete installed Operators from a selected namespace by using the web console.

Prerequisites
  • You have access to an OKD cluster web console using an account with cluster-admin permissions.

Procedure
  1. Navigate to the OperatorsInstalled Operators page.

  2. Scroll or enter a keyword into the Filter by name field to find the Operator that you want to remove. Then, click on it.

  3. On the right side of the Operator Details page, select Uninstall Operator from the Actions list.

    An Uninstall Operator? dialog box is displayed.

  4. Select Uninstall to remove the Operator, Operator deployments, and pods. Following this action, the Operator stops running and no longer receives updates.

    This action does not remove resources managed by the Operator, including custom resource definitions (CRDs) and custom resources (CRs). Dashboards and navigation items enabled by the web console and off-cluster resources that continue to run might need manual clean up. To remove these after uninstalling the Operator, you might need to manually delete the Operator CRDs.

Deleting Operators from a cluster using the CLI

Cluster administrators can delete installed Operators from a selected namespace by using the CLI.

Prerequisites
  • Access to an OKD cluster using an account with cluster-admin permissions.

  • oc command installed on workstation.

Procedure
  1. Ensure the latest version of the subscribed operator (for example, serverless-operator) is identified in the currentCSV field.

    $ oc get subscription.operators.coreos.com serverless-operator -n openshift-serverless -o yaml | grep currentCSV
    Example output
      currentCSV: serverless-operator.v1.28.0
  2. Delete the subscription (for example, serverless-operator):

    $ oc delete subscription.operators.coreos.com serverless-operator -n openshift-serverless
    Example output
    subscription.operators.coreos.com "serverless-operator" deleted
  3. Delete the CSV for the Operator in the target namespace using the currentCSV value from the previous step:

    $ oc delete clusterserviceversion serverless-operator.v1.28.0 -n openshift-serverless
    Example output
    clusterserviceversion.operators.coreos.com "serverless-operator.v1.28.0" deleted