Chapter 5. Uninstalling OpenShift sandboxed containers


You can uninstall OpenShift sandboxed containers by using either the Red Hat OpenShift web console or OpenShift CLI (oc). Both procedures are explained below.

5.1. Uninstalling OpenShift sandboxed containers using the web console

Use the Red Hat OpenShift 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 Red Hat OpenShift 4.13 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

  1. From the Administrator perspective, navigate to Workloads Pods.
  2. Search for the pod that you want to delete using the Search by name field.
  3. Click the pod name to open it.
  4. On the Details page, check that kata is displayed for Runtime class.
  5. Click the Actions menu and select Delete Pod.
  6. 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 Red Hat OpenShift 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 Red Hat OpenShift 4.13 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

  1. From the Administrator perspective, navigate to Operators Installed Operators.
  2. Search for the OpenShift sandboxed containers Operator using the Search by name field.
  3. Click the Operator to open it, and then select the KataConfig tab.
  4. Click the Options menu kebab for the KataConfig resource, and then select Delete KataConfig.
  5. 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.

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 Red Hat OpenShift 4.13 installed on your cluster.
  • You have access to the cluster as a user with the cluster-admin role.

Procedure

  1. From the Administrator perspective, navigate to Operators Installed Operators.
  2. Search for the OpenShift sandboxed containers Operator using the Search by name field.
  3. Click the Options menu kebab for the Operator and select Uninstall Operator.
  4. 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 Red Hat OpenShift 4.13 installed on your cluster.
  • You have access to the cluster as a user with the cluster-admin role.

Procedure

  1. From the Administrator perspective, navigate to Administration Namespaces.
  2. Search for the openshift-sandboxed-containers-operator namespace using the Search by name field.
  3. Click the Options menu kebab 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.

  4. In the Delete Namespace pane, enter openshift-sandboxed-containers-operator and click Delete.
  5. 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 Red Hat OpenShift 4.13 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

  1. From the Administrator perspective, navigate to Administration CustomResourceDefinitions.
  2. Search for KataConfig using the Search by name field.
  3. Click the Options menu kebab for the KataConfig CRD, and then select Delete CustomResourceDefinition.
  4. Click Delete in the confirmation window.
  5. 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 Red Hat OpenShift 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

  1. Search for pods that use kata as the runtimeClass by running the following command:

    $ oc get pods -A -o json | jq -r '.items[] | select(.spec.runtimeClassName == "kata").metadata.name'
  2. To delete each pod, run the following command:

    $ 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 Red Hat OpenShift 4.13 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 Red Hat OpenShift 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.

Procedure

  1. Delete the KataConfig custom resource by running the following command:

    $ 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 next procedure.

Verification

  • To verify that the KataConfig custom resource is deleted, run the following command:

    $ 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 Red Hat OpenShift 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

  1. Fetch 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)
  2. Delete the OpenShift sandboxed containers Operator subscription from Operator Lifecyle Manager (OLM) by running the following command:

    $ oc delete subscription sandboxed-containers-operator -n openshift-sandboxed-containers-operator
  3. Delete the CSV name for OpenShift sandboxed containers by running the following command:

    $ oc delete csv ${CSV_NAME} -n openshift-sandboxed-containers-operator
  4. Fetch the OpenShift sandboxed containers Operator group name by running the following command:

    $ OG_NAME=$(oc get operatorgroup -n openshift-sandboxed-containers-operator -o=jsonpath={..name})
  5. Delete the OpenShift sandboxed containers Operator group name by running the following command:

    $ oc delete operatorgroup ${OG_NAME} -n openshift-sandboxed-containers-operator
  6. Delete the OpenShift sandboxed containers namespace by running the following command:

    $ 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

  1. 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

Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.