Chapter 5. Uninstalling OpenShift sandboxed containers
Chapter 5. Uninstalling OpenShift sandboxed containers You can uninstall OpenShift sandboxed containers by using either the OpenShift Container Platform web console or OpenShift CLI ( oc ). Both procedures are explained below. 5.1. Uninstalling OpenShift sandboxed containers using the web console Use the OpenShift Container Platform web console to delete the relevant OpenShift sandboxed containers pods, resources, and namespace. 5.1.1. Deleting OpenShift sandboxed containers pods using the web console To uninstall OpenShift sandboxed containers, you must first delete all running pods that use kata as the runtimeClass . Prerequisites You have OpenShift Container Platform 4.11 installed on your cluster. You have access to the cluster as a user with the cluster-admin role. You have a list of the pods that use kata as the runtimeClass . Procedure From the Administrator perspective, navigate to Workloads Pods . Search for the pod that you want to delete using the Search by name field. Click the pod name to open it. On the Details page, check that kata is displayed for Runtime class . Click the Actions menu and select Delete Pod . Click Delete in the confirmation window. Additional resources You can retrieve a list of running pods that use kata as the runtimeClass from the OpenShift CLI. For details, see Deleting OpenShift sandboxed containers pods . 5.1.2. Deleting the KataConfig custom resource using the web console Deleting the KataConfig custom resource (CR) removes and uninstalls the kata runtime and its related resources from your cluster. Important Deleting the KataConfig CR automatically reboots the worker nodes. The reboot can take from 10 to more than 60 minutes. Factors that impede reboot time are as follows: A larger OpenShift Container Platform deployment with a greater number of worker nodes. Activation of the BIOS and Diagnostics utility. Deployment on a hard drive rather than on an SSD. Deployment on physical nodes such as bare metal, rather than on virtual nodes. A slow CPU or network. Prerequisites You have OpenShift Container Platform 4.11 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 runtimeClass . Procedure From the Administrator perspective, navigate to Operators Installed Operators . Search for the OpenShift sandboxed containers Operator using the Search by name field. Click the Operator to open it, and then select the KataConfig tab. Click the Options menu for the KataConfig resource, and then select Delete KataConfig . Click Delete in the confirmation window. Wait for the kata runtime and resources to uninstall and for the worker nodes to reboot before continuing to the step. 5.1.3. Deleting the OpenShift sandboxed containers Operator using the web console Deleting the OpenShift sandboxed containers Operator removes the catalog subscription, Operator group, and cluster service version (CSV) for that Operator. Prerequisites You have OpenShift Container Platform 4.11 installed on your cluster. You have access to the cluster as a user with the cluster-admin role. Procedure From the Administrator perspective, navigate to Operators Installed Operators . Search for the OpenShift sandboxed containers Operator using the Search by name field. Click the Options menu for the Operator and select Uninstall Operator . Click Uninstall in the confirmation window. 5.1.4. Deleting the OpenShift sandboxed containers namespace using the web console After you run the preceding commands, your cluster is restored to the state that it was prior to the installation process. You can now revoke namespace access to the Operator by deleting the openshift-sandboxed-containers-operator namespace. Prerequisites You have OpenShift Container Platform 4.11 installed on your cluster. You have access to the cluster as a user with the cluster-admin role. Procedure From the Administrator perspective, navigate to Administration Namespaces . Search for the openshift-sandboxed-containers-operator namespace using the Search by name field. Click the Options menu for the namespace and select Delete Namespace . Note If the Delete Namespace option is not available, you do not have permission to delete the namespace. In the Delete Namespace pane, enter openshift-sandboxed-containers-operator and click Delete . Click Delete . 5.1.5. Deleting the KataConfig custom resource definition using the web console The KataConfig custom resource definition (CRD) lets you define the KataConfig CR. To complete the uninstall process, delete the KataConfig CRD from your cluster. Prerequisites You have OpenShift Container Platform 4.11 installed on your cluster. You have access to the cluster as a user with the cluster-admin role. You have removed the KataConfig CR from your cluster. You have removed the OpenShift sandboxed containers Operator from your cluster. Procedure From the Administrator perspective, navigate to Administration CustomResourceDefinitions . Search for KataConfig using the Search by name field. Click the Options menu for the KataConfig CRD, and then select Delete CustomResourceDefinition . Click Delete in the confirmation window. Wait for the KataConfig CRD to disappear from the list. This can take several minutes. 5.2. Uninstalling OpenShift sandboxed containers using the CLI You can uninstall OpenShift sandboxed containers by using the OpenShift Container Platform command-line interface (CLI) . Follow the steps below in the order that they are presented. 5.2.1. Deleting OpenShift sandboxed containers pods using the CLI To uninstall OpenShift sandboxed containers, you must first delete all running pods that use kata as the runtimeClass . Prerequisites You have installed the OpenShift CLI ( oc ). You have the command-line JSON processor ( jq ) installed. Procedure Search for pods that use kata as the runtimeClass by running the following command: USD oc get pods -A -o json | jq -r '.items[] | select(.spec.runtimeClassName == "kata").metadata.name' To delete each pod, run the following command: USD oc delete pod <pod-name> 5.2.2. Deleting the KataConfig custom resource using the CLI 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.11 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. Important Deleting the KataConfig CR automatically reboots the worker nodes. The reboot can take from 10 to more than 60 minutes. Factors that impede reboot time are as follows: A larger OpenShift Container Platform deployment with a greater number of worker nodes. Activation of the BIOS and Diagnostics utility. Deployment on a hard drive rather than on an SSD. Deployment on physical nodes such as bare metal, rather than on virtual nodes. A slow CPU or network. Procedure Delete the KataConfig custom resource by running the following command: USD oc delete kataconfig <KataConfig_CR_Name> The OpenShift sandboxed containers Operator removes all resources that were initially created to enable the runtime on your cluster. Important During deletion, the CLI stops responding until all worker nodes reboot. Wait for the process to complete before performing the verification or continuing to the procedure. 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 5.2.3. Deleting the OpenShift sandboxed containers Operator using the CLI Remove the OpenShift sandboxed containers Operator from your cluster by deleting the Operator subscription, Operator group, cluster service version (CSV), and namespace. Prerequisites You have OpenShift Container Platform 4.10 installed on your cluster. You have installed the OpenShift CLI ( oc ). You have installed the comand-line JSON processor ( jq ). You have access to the cluster as a user with the cluster-admin role. Procedure Fetch the cluster service version (CSV) name for OpenShift sandboxed containers from the subscription by running the following command: CSV_NAME=USD(oc get csv -n openshift-sandboxed-containers-operator -o=custom-columns=:metadata.name) Delete the OpenShift sandboxed containers Operator subscription from Operator Lifecyle Manager (OLM) by running the following command: USD oc delete subscription sandboxed-containers-operator -n openshift-sandboxed-containers-operator 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 Fetch the OpenShift sandboxed containers Operator group name by running the following command: USD OG_NAME=USD(oc get operatorgroup -n openshift-sandboxed-containers-operator -o=jsonpath={..name}) Delete the OpenShift sandboxed containers Operator group name by running the following command: USD oc delete operatorgroup USD{OG_NAME} -n openshift-sandboxed-containers-operator Delete the OpenShift sandboxed containers namespace by running the following command: USD oc delete namespace openshift-sandboxed-containers-operator 5.2.4. Deleting the KataConfig custom resource definition using the CLI The KataConfig custom resource definition (CRD) lets you define the KataConfig CR. Delete the KataConfig CRD from your cluster. Prerequisites You have installed the OpenShift CLI ( oc ). You have access to the cluster as a user with the cluster-admin role. You have removed the KataConfig CR from your cluster. You have removed the OpenShift sandboxed containers Operator from your cluster. Procedure Delete the KataConfig CRD by running the following command: USD oc delete crd kataconfigs.kataconfiguration.openshift.io Verification To verify that the KataConfig CRD is deleted, run the following command: USD oc get crd kataconfigs.kataconfiguration.openshift.io Example output Unknown CR KataConfig
oc get pods -A -o json | jq -r '.items[] | select(.spec.runtimeClassName == "kata").metadata.name' oc delete pod <pod-name> oc delete kataconfig <KataConfig_CR_Name> oc get kataconfig <KataConfig_CR_Name> No KataConfig instances exist CSV_NAME=USD(oc get csv -n openshift-sandboxed-containers-operator -o=custom-columns=:metadata.name) oc delete subscription sandboxed-containers-operator -n openshift-sandboxed-containers-operator oc delete csv USD{CSV_NAME} -n openshift-sandboxed-containers-operator OG_NAME=USD(oc get operatorgroup -n openshift-sandboxed-containers-operator -o=jsonpath={..name}) oc delete operatorgroup USD{OG_NAME} -n openshift-sandboxed-containers-operator oc delete namespace openshift-sandboxed-containers-operator oc delete crd kataconfigs.kataconfiguration.openshift.io oc get crd kataconfigs.kataconfiguration.openshift.io Unknown CR KataConfig