Chapter 6. Uninstalling
You can uninstall OpenShift sandboxed containers by using the OpenShift Container Platform web console or the command line.
Uninstall workflow
- Delete workload pods.
-
Delete the
KataConfig
custom resource. - Uninstall the OpenShift sandboxed containers Operator.
-
Delete the
KataConfig
custom resource definition.
6.1. Uninstalling by using the web console
You can uninstall OpenShift sandboxed containers by using the OpenShift Container Platform web console.
6.1.1. Deleting workload pods
You can delete the OpenShift sandboxed containers workload pods by using the OpenShift Container Platform web console.
Prerequisites
-
You have access to the cluster as a user with the
cluster-admin
role. - You have a list of pods that use the OpenShift sandboxed containers runtime class.
Procedure
-
In the OpenShift Container Platform web console, navigate to Workloads
Pods. - Enter the name of the pod that you want to delete in the Search by name field.
- Click the pod name to open it.
-
On the Details page, check that
kata
orkata-remote
is displayed for Runtime class. - Click the Options menu and select Delete Pod.
- Click Delete.
6.1.2. Deleting the KataConfig CR
You can delete the KataConfig
custom resource (CR) by using the web console. Deleting the KataConfig
CR removes and uninstalls the kata
runtime and its related resources from your cluster.
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 an SSD.
- Deployment on physical nodes such as bare metal, rather than on virtual nodes.
- A slow CPU and network.
Prerequisites
-
You have access to the cluster as a user with the
cluster-admin
role. -
You have deleted all running pods that use
kata
as theruntimeClass
.
Procedure
-
In the OpenShift Container Platform web console, 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 DeleteKataConfig
. - 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 next step.
6.1.3. Uninstalling the Operator
You can uninstall the OpenShift sandboxed containers Operator by using OpenShift Container Platform web console. Uninstalling the Operator removes the catalog subscription, Operator group, and cluster service version (CSV) for that Operator. Then, you delete the openshift-sandboxed-containers-operator
namespace.
Prerequisites
-
You have access to the cluster as a user with the
cluster-admin
role.
Procedure
-
In the OpenShift Container Platform web console, navigate to Operators
Installed Operators. - Enter the OpenShift sandboxed containers Operator name in the Search by name field.
- Click the Options menu for the Operator and select Uninstall Operator.
- Click Uninstall in the confirmation window.
-
Enter the
openshift-sandboxed-containers-operator
name in the Search by name field. Click the Options menu for the namespace and select Delete Namespace.
NoteIf the Delete Namespace option is not available, you do not have permission to delete the namespace.
-
In the Delete Namespace window, enter
openshift-sandboxed-containers-operator
and click Delete. - Click Delete.
6.1.4. Deleting the KataConfig CRD
You can delete the KataConfig
custom resource definition (CRD) by using the OpenShift Container Platform web console.
Prerequisites
-
You have access to the cluster as a user with the
cluster-admin
role. -
You deleted the
KataConfig
CR. - You uninstalled the OpenShift sandboxed containers Operator.
Procedure
-
In the web console, navigate to Administration
CustomResourceDefinitions. -
Enter the
KataConfig
name in the Search by name field. -
Click the Options menu
for the
KataConfig
CRD, and select Delete CustomResourceDefinition. - Click Delete in the confirmation window.
-
Wait for the
KataConfig
CRD to disappear from the list. This can take several minutes.
6.2. Uninstalling by using the CLI
You can uninstall OpenShift sandboxed containers by using the command-line interface (CLI).
6.2.1. Deleting workload pods
You can delete the OpenShift sandboxed containers workload pods by using the CLI.
Prerequisites
-
You have the JSON processor (
jq
) utility installed.
Procedure
Search for the pods by running the following command:
$ oc get pods -A -o json | jq -r '.items[] | \ select(.spec.runtimeClassName == "<runtime>").metadata.name' 1
- 1
- Specify
kata
for bare metal deployments. Specifykata-remote
for public cloud, IBM Z®, and IBM® LinuxONE deployments.
Delete each pod by running the following command:
$ oc delete pod <pod>
6.2.2. Deleting the KataConfig CR
You can delete the KataConfig
custom resource (CR) by using the command line.
Deleting the KataConfig
CR removes the runtime and its related resources from your cluster.
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 an SSD.
- Deployment on physical nodes such as bare metal, rather than on virtual nodes.
- A slow CPU and network.
Prerequisites
-
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
CR by running the following command:$ oc delete kataconfig <kataconfig>
The OpenShift sandboxed containers Operator removes all resources that were initially created to enable the runtime on your cluster.
When you delete the KataConfig
CR, the CLI stops responding until all worker nodes reboot. You must for the deletion process to complete before performing the verification.
To verify that the
KataConfig
custom resource is deleted, run the following command:$ oc get kataconfig <kataconfig>
Example output
No KataConfig instances exist
6.2.3. Uninstalling the Operator
You can uninstall the OpenShift sandboxed containers Operator by using the CLI. You uninstall the Operator by deleting the Operator subscription, Operator group, cluster service version (CSV), and namespace.
Prerequisites
-
You have installed the OpenShift CLI (
oc
). -
You have installed the command-line JSON processor (
jq
). -
You have access to the cluster as a user with the
cluster-admin
role.
Procedure
Obtain the cluster service version (CSV) name for OpenShift sandboxed containers from the subscription by running the following command:
CSV_NAME=$(oc get csv -n openshift-sandboxed-containers-operator -o=custom-columns=:metadata.name)
Delete the Operatorsubscription from Operator Lifecyle Manager (OLM) by running the following command:
$ oc delete subscription sandboxed-containers-operator -n openshift-sandboxed-containers-operator
Delete the CSV name for OpenShift sandboxed containers by running the following command:
$ oc delete csv ${CSV_NAME} -n openshift-sandboxed-containers-operator
Obtain the Operator group name by running the following command:
$ OG_NAME=$(oc get operatorgroup -n openshift-sandboxed-containers-operator -o=jsonpath={..name})
Delete the Operator group name by running the following command:
$ oc delete operatorgroup ${OG_NAME} -n openshift-sandboxed-containers-operator
Delete the Operator namespace by running the following command:
$ oc delete namespace openshift-sandboxed-containers-operator
6.2.4. Deleting the KataConfig CRD
You can delete the KataConfig
custom resource definition (CRD) by using the command line.
Prerequisites
-
You have installed the OpenShift CLI (
oc
). -
You have access to the cluster as a user with the
cluster-admin
role. -
You deleted the
KataConfig
CR. - You uninstalled the OpenShift sandboxed containers Operator.
Procedure
Delete the
KataConfig
CRD by running the following command:$ oc delete crd kataconfigs.kataconfiguration.openshift.io
Verification
To verify that the
KataConfig
CRD is deleted, run the following command:$ oc get crd kataconfigs.kataconfiguration.openshift.io
Example output
Unknown CR KataConfig