Chapter 4. Uninstalling OpenShift sandboxed containers 4.1. Uninstalling OpenShift sandboxed containers using the web console You can uninstall OpenShift sandboxed containers by using the OpenShift Container Platform web console. 4.1.1. Deleting OpenShift sandboxed containers resources To uninstall OpenShift sandboxed containers, you must first delete the OpenShift sandboxed containers custom resource KataConfig . This removes and uninstalls the kata runtime and its related resources from your cluster. Prerequisites You have OpenShift Container Platform 4.9 installed on your cluster. You have access to the cluster as a user with the cluster-admin role. You have no running pods that use kata as the runtimeClassName . You have installed the OpenShift CLI ( oc ). You the command-line JSON processor ( jq ) installed. Verify that you have no running pods that use kata as the runtimeClassName by running the following command: USD oc get pods -A -o json | jq -r '.items[] | select(.spec.runtimeClassName | test("kata")).metadata.name' Procedure Delete all pods that use runtimeClassName with the value of kata . From the OpenShift Container Platform web console, select openshift-sandboxed-containers from the Projects list. Navigate to the Operators Installed Operators page. Click OpenShift sandboxed containers . Click the OpenShift sandboxed containers Operator tab. Click the scroll-down list in the Operator Details , and then click Delete KataConfig . Click Delete in the confirmation window. 4.1.1.1. Deleting a namespace using the web console You can delete a namespace by using the OpenShift Container Platform web console. Prerequisites You have OpenShift Container Platform 4.9 installed on your cluster. You have access to the cluster as a user with the cluster-admin role. Procedure Navigate to Administration Namespaces . Locate the openshift-sandboxed-containers-operator namespace to delete in the list of namespaces. On the rightmost side of the namespace listing, select Delete Namespace from the Options menu . When the Delete Namespace pane opens, enter openshift-sandboxed-containers-operator in the field. Note If the Delete Namespace option is not available, you do not have permission to delete the namespace. Click Delete . 4.1.2. Deleting OpenShift sandboxed containers Operator You can delete the OpenShift sandboxed containers Operator by deleting the catalog subscription and revoking namespace access to the Operator. Prerequisites You have OpenShift Container Platform 4.9 installed on your cluster. You have access to the cluster as a user with the cluster-admin role. Procedure Navigate to the Operators OperatorHub page. Search for OpenShift sandboxed containers and then select the Operator. Click Uninstall . Delete the openshift-sandboxed-containers-operator namespace. 4.2. Uninstalling Kata runtime from the CLI You can uninstall OpenShift sandboxed containers by using the OpenShift Container Platform command-line interface (CLI) . 4.2.1. Deleting OpenShift sandboxed containers resources You can remove and uninstall the kata runtime and all its related resources, such as CRI-O config and RuntimeClass , from your cluster. Prerequisites You have OpenShift Container Platform 4.9 installed on your cluster. You have installed the OpenShift CLI ( oc ). You have access to the cluster as a user with the cluster-admin role. Procedure Delete the KataConfig custom resource by running the following command: USD oc delete kataconfig <KataConfig_CR_Name> Delete the KataConfig custom resource definition by running the following command: USD oc delete crd kataconfigs.kataconfiguration.openshift.io The OpenShift sandboxed containers Operator removes all resources that were initially created to enable the runtime on your cluster. After you run the preceding commands, your cluster is restored to the state that it was prior to the installation process. You can now delete the openshift-sandboxed-containers-operator namespace. Verification To verify that the KataConfig custom resource is deleted, run the following command: USD oc get kataconfig <KataConfig_CR_Name> Example output No KataConfig instances exist To verify that the KataConfig custom resource definition is deleted, run the following command: USD oc get crd kataconfigs.kataconfiguration.openshift.io Example output Unknown CR KataConfig 4.2.2. Deleting OpenShift sandboxed containers Operator You can delete the OpenShift sandboxed containers Operator from your cluster. Prerequisites You have OpenShift Container Platform 4.9 installed on your cluster. You have installed the OpenShift CLI ( oc ). You have access to the cluster as a user with the cluster-admin role. Procedure Delete the OpenShift sandboxed containers Operator subscription from Operator Lifecyle Manager (OLM) by running the following command: USD oc delete subscription openshift-sandboxed-containers-subscription -n openshift-sandboxed-containers-operator Set the cluster service version (CSV) name for OpenShift sandboxed containers as an environment variable by running the following command: CSV_NAME=USD(oc get csv -n openshift-sandboxed-containers-operator -o=custom-columns=:metadata.name) Delete the CSV name for OpenShift sandboxed containers by running the following command: USD oc delete csv USD{CSV_NAME} -n openshift-sandboxed-containers-operator

Commands:
oc get pods -A -o json | jq -r '.items[] | select(.spec.runtimeClassName | test("kata")).metadata.name'
oc delete kataconfig <KataConfig_CR_Name>
oc delete crd kataconfigs.kataconfiguration.openshift.io
oc get kataconfig <KataConfig_CR_Name>
No KataConfig instances exist
oc get crd kataconfigs.kataconfiguration.openshift.io
Unknown CR KataConfig
oc delete subscription openshift-sandboxed-containers-subscription -n openshift-sandboxed-containers-operator
CSV_NAME=USD(oc get csv -n openshift-sandboxed-containers-operator -o=custom-columns=:metadata.name)
oc delete csv USD{CSV_NAME} -n openshift-sandboxed-containers-operator