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:
Go to the Operators → Installed Operators → Compliance Operator page.
Click All instances.
In All namespaces, click the Options menu and delete all ScanSettingBinding, ComplainceSuite, ComplianceScan, and ProfileBundle objects.
Switch to the Administration → Operators → Installed Operators page.
Click the Options menu on the Compliance Operator entry and select Uninstall Operator.
Switch to the Home → Projects page.
Search for ‘compliance’.
Click the Options menu next to the openshift-compliance project, and select Delete Project.
- Confirm the deletion by typing
openshift-compliance
in the dialog box, and click Delete.
- Confirm the deletion by typing
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
Delete all objects in the namespace.
Delete the
ScanSettingBinding
objects:$ oc delete ssb <ScanSettingBinding-name> -n openshift-compliance
Delete the
ScanSetting
objects:$ oc delete ss <ScanSetting-name> -n openshift-compliance
Delete the
ComplianceSuite
objects:$ oc delete suite <compliancesuite-name> -n openshift-compliance
Delete the
ComplianceScan
objects:$ oc delete scan <compliancescan-name> -n openshift-compliance
Obtain the
ProfileBundle
objects:$ oc get profilebundle.compliance -n openshift-compliance
Example output
NAME CONTENTIMAGE CONTENTFILE STATUS
ocp4 registry.redhat.io/compliance/openshift-compliance-content-rhel8@sha256:<hash> ssg-ocp4-ds.xml VALID
rhcos4 registry.redhat.io/compliance/openshift-compliance-content-rhel8@sha256:<hash> ssg-rhcos4-ds.xml VALID
Delete the
ProfileBundle
objects:$ oc delete profilebundle.compliance ocp4 rhcos4 -n openshift-compliance
Example output
profilebundle.compliance.openshift.io "ocp4" deleted
profilebundle.compliance.openshift.io "rhcos4" deleted
Delete the Subscription object:
$ oc delete sub <Subscription-Name> -n openshift-compliance
Delete the CSV object:
$ oc delete CSV -n openshift-compliance
Delete the project:
$ oc delete project -n openshift-compliance
Example output
project.project.openshift.io "openshift-compliance" deleted
Verification
Confirm the namespace is deleted:
$ oc get project/openshift-compliance
Example output
Error from server (NotFound): namespaces "openshift-compliance" not found