Uninstalling the Compliance Operator

You can remove the OpenShift Compliance Operator from your cluster by using the OKD web console or the CLI.

Uninstalling the OpenShift Compliance Operator from OKD using the web console

To remove the Compliance Operator, you must first delete the objects in the namespace. After the objects are removed, you can remove the Operator and its namespace by deleting the openshift-compliance project.

Prerequisites

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

  • The OpenShift Compliance Operator must be installed.

Procedure

To remove the Compliance Operator by using the OKD web console:

  1. Go to the OperatorsInstalled OperatorsCompliance Operator page.

    1. Click All instances.

    2. In All namespaces, click the Options menu kebab and delete all ScanSettingBinding, ComplainceSuite, ComplianceScan, and ProfileBundle objects.

  2. Switch to the AdministrationOperatorsInstalled Operators page.

  3. Click the Options menu kebab on the Compliance Operator entry and select Uninstall Operator.

  4. Switch to the HomeProjects page.

  5. Search for ‘compliance’.

  6. Click the Options menu kebab next to the openshift-compliance project, and select Delete Project.

    1. Confirm the deletion by typing openshift-compliance in the dialog box, and click Delete.

Uninstalling the OpenShift Compliance Operator from OKD using the CLI

To remove the Compliance Operator, you must first delete the objects in the namespace. After the objects are removed, you can remove the Operator and its namespace by deleting the openshift-compliance project.

Prerequisites

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

  • The OpenShift Compliance Operator must be installed.

Procedure

  1. Delete all objects in the namespace.

    1. Delete the ScanSettingBinding objects:

      1. $ oc delete ssb <ScanSettingBinding-name> -n openshift-compliance
    2. Delete the ScanSetting objects:

      1. $ oc delete ss <ScanSetting-name> -n openshift-compliance
    3. Delete the ComplianceSuite objects:

      1. $ oc delete suite <compliancesuite-name> -n openshift-compliance
    4. Delete the ComplianceScan objects:

      1. $ oc delete scan <compliancescan-name> -n openshift-compliance
    5. Obtain the ProfileBundle objects:

      1. $ oc get profilebundle.compliance -n openshift-compliance

      Example output

      1. NAME CONTENTIMAGE CONTENTFILE STATUS
      2. ocp4 registry.redhat.io/compliance/openshift-compliance-content-rhel8@sha256:<hash> ssg-ocp4-ds.xml VALID
      3. rhcos4 registry.redhat.io/compliance/openshift-compliance-content-rhel8@sha256:<hash> ssg-rhcos4-ds.xml VALID
    6. Delete the ProfileBundle objects:

      1. $ oc delete profilebundle.compliance ocp4 rhcos4 -n openshift-compliance

      Example output

      1. profilebundle.compliance.openshift.io "ocp4" deleted
      2. profilebundle.compliance.openshift.io "rhcos4" deleted
  2. Delete the Subscription object:

    1. $ oc delete sub <Subscription-Name> -n openshift-compliance
  3. Delete the CSV object:

    1. $ oc delete CSV -n openshift-compliance
  4. Delete the project:

    1. $ oc delete project -n openshift-compliance

    Example output

    1. project.project.openshift.io "openshift-compliance" deleted

Verification

  1. Confirm the namespace is deleted:

    1. $ oc get project/openshift-compliance

    Example output

    1. Error from server (NotFound): namespaces "openshift-compliance" not found