Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update uninstallation guide #2281

Merged
merged 14 commits into from
Apr 26, 2022
5 changes: 2 additions & 3 deletions modules/administration-guide/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,5 @@
** xref:upgrading-che-using-the-cli-management-tool.adoc[]
** xref:upgrading-che-using-the-cli-management-tool-in-restricted-environment.adoc[]
* xref:uninstalling-che.adoc[]
** xref:uninstalling-che-after-operatorhub-installation-using-openshift-web-console.adoc[]
** xref:uninstalling-che-after-operatorhub-installation-using-openshift-cli.adoc[]
** xref:uninstalling-che-after-chectl-installation.adoc[]
** xref:uninstalling-che-on-openshift.adoc[]
** xref:uninstalling-che-by-using-chectl.adoc[]

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
:_content-type: PROCEDURE
:navtitle: Uninstalling {prod-short} by using {prod-cli}
:keywords: administration guide, uninstalling-che, uninstalling-che-after-chectl-installation
:page-aliases: installation-guide:uninstalling-che-after-chectl-installation

[id="uninstalling-{prod-id-short}-by-using-{prod-cli}_{context}"]
= Uninstalling {prod-short} by using `{prod-cli}`

To uninstall an instance of {prod} that was installed using the `{prod-cli}` tool on {platforms-name}:

.Prerequisites

* The `{prod-cli}` tool was used to install the {prod-short} instance on {platforms-name}.
* The `{prod-cli}` and `{orch-cli}` tools are available.

.Procedure

. Obtain the name of the {prod-short} namespace:

+
`$ {orch-cli} get checluster --all-namespaces -o=jsonpath="{.items[*].metadata.namespace}"`

. Remove the {prod-short} instance from the {orch-namespace}:

+
`$ {prod-cli} server:delete -n __<{orch-namespace}>__`

+
[NOTE]
====
If uninstalling {prod-short} from a Minikube cluster, optionally remove the `dex` namespace.
dkwon17 marked this conversation as resolved.
Show resolved Hide resolved

`$ {orch-cli} delete namespaces dex`
dkwon17 marked this conversation as resolved.
Show resolved Hide resolved
====
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
:_content-type: ASSEMBLY
:navtitle: Uninstalling {prod-short} on OpenShift
:keywords: administration guide, uninstalling-che, uninstalling-che-after-operatorhub-installation
:page-aliases: .:installation-guide:uninstalling-che-after-operatorhub-installation

[id="uninstalling-{prod-id-short}-on-openshift_{context}"]
= Uninstalling {prod-short} on OpenShift

IMPORTANT: To uninstall an instance of {prod} that was installed using the `{prod-cli}` tool on {ocp} or {osd}, go to xref:uninstalling-che-by-using-chectl.adoc[].

To uninstall an {prod} instance that was installed using OperatorHub on {ocp} or {osd}:

. Uninstall the {devworkspace} Operator and related Custom Resources.

. Uninstall the {prod-short} instance and the {prod} Operator.

include::partial$proc_uninstalling-the-devworkspace-operator.adoc[leveloffset=+1]

include::partial$assembly_uninstalling-the-che-instance-and-the-che-operator.adoc[leveloffset=+1]
10 changes: 5 additions & 5 deletions modules/administration-guide/pages/uninstalling-che.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

:context: uninstalling-{prod-id-short}

This section describes uninstallation procedures for {prod}. The uninstallation process leads to a complete removal of {prod-short}-related user data. The method previously used to install the {prod-short} instance determines the uninstallation method.
WARNING: Uninstalling {prod-short} removes all {prod-short}-related user data!

* For {prod-short} installed using OperatorHub, for the OpenShift Web Console method see xref:uninstalling-che-after-operatorhub-installation-using-openshift-web-console.adoc[].
How the {prod-short} instance was installed determines the uninstallation procedure:

* For {prod-short} installed using OperatorHub, for the CLI method see xref:uninstalling-che-after-operatorhub-installation-using-openshift-cli.adoc[].
* If the {prod-short} instance was installed using OperatorHub, then see xref:uninstalling-che-on-openshift.adoc[].

* For {prod-short} installed using {prod-cli}, see xref:uninstalling-che-after-chectl-installation.adoc[]
* If the {prod-short} instance was installed using `{prod-cli}`, then see xref:uninstalling-che-by-using-chectl.adoc[].

:context: {parent-context-of-uninstalling-che}
:context: {parent-context-of-uninstalling-che}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[id="uninstalling-the-che-instance-and-the-che-operator_{context}"]
= Uninstalling the {prod-short} instance and the {prod} Operator

After uninstalling the {devworkspace} Operator, uninstall the {prod-short} instance and the {prod} Operator by using either the OpenShift web console or the OpenShift CLI.

include::partial$proc_uninstalling-che-by-using-the-openshift-web-console.adoc[leveloffset=0]
include::partial$proc_uninstalling-che-by-using-the-openshift-cli.adoc[leveloffset=0]
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[id="uninstalling-che-by-using-the-openshift-cli_{context}"]
=== Uninstalling {prod-short} by using the OpenShift CLI

To uninstall the {prod-short} instance and the {prod} Operator by using the OpenShift CLI:

.Prerequisites

* OperatorHub was used to install the {prod-short} instance on {ocp} or {osd}.
* You have access to the OpenShift web console of your organization's {prod-short} instance.
* The OpenShift CLI (`oc`) is installed in the operating system you are using. See link:https://docs.openshift.com/container-platform/4.10/cli_reference/openshift_cli/getting-started-cli.html#installing-openshift-cli[Installing the OpenShift CLI].

.Procedure

. Sign in to the cluster.

+
`$ oc login -u __<username>__ -p __<password>__ __<cluster_url>__`

. Switch to the namespace where the {prod-short} instance is deployed:

+
`$ oc project __<{prod-id-short}_namespace>__`

. Obtain the `CheCluster` `NAME`:

+
`$ oc get checluster`

. Delete the {prod-short} cluster:

+
`$ oc delete checluster __<checluster_name>__`

. Obtain the `NAME` of the {prod-short} cluster service version (CSV):

+
`$ oc get csv`

. Delete the {prod-short} CSV:

+
`$ oc delete csv __<csv_name>__`

+
This uninstalls the {prod} Operator.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[id="uninstalling-che-by-using-the-openshift-web-console_{context}"]
=== Uninstalling {prod-short} by using the OpenShift web console

To uninstall the {prod-short} instance and the {prod} Operator by using the OpenShift web console:

.Prerequisites

* OperatorHub was used to install the {prod-short} instance on {ocp} or {osd}.
* You have access to the OpenShift web console of your organization's {prod-short} instance.

.Procedure

. In the OpenShift web console, go to menu:Administrator[Operators].

. menu:Installed Operators[{prod} instance Specification>⋮>Delete CheCluster>Delete].

. menu:Installed Operators[{prod}>⋮>Uninstall Operator>Uninstall].
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
[id="uninstalling-the-devworkspace-operator_{context}"]
= Uninstalling the {devworkspace} Operator

To uninstall the {devworkspace} Operator and related Custom Resources:

.Prerequisites

* OperatorHub was used to install the {prod-short} instance on {ocp} or {osd}.

* You have access to the OpenShift cluster of your organization's {prod-short} instance.

* The OpenShift CLI (`oc`) is installed in the operating system you are using. See link:https://docs.openshift.com/container-platform/4.10/cli_reference/openshift_cli/getting-started-cli.html#installing-openshift-cli[Installing the OpenShift CLI].

.Procedure

. Optional: Sign in to the cluster.

+
`$ oc login -u __<username>__ -p __<password>__ __ <cluster_url>__`

. Remove the {devworkspace} Custom Resources used by the Operator, along with any related {orch-name} objects such as Deployments:

+
`$ oc delete devworkspaces.workspace.devfile.io --all-namespaces --all --wait && oc delete devworkspaceroutings.controller.devfile.io --all-namespaces --all --wait`
+
[WARNING]
====
If you do not complete this step, pass:[<!-- vale RedHat.Spelling = NO -->]finalizerspass:[<!-- vale RedHat.Spelling = YES -->] may impede fully uninstalling the Operator.
====

. Remove the CRDs used by the Operator:

+
`$ oc delete customresourcedefinitions.apiextensions.k8s.io devworkspaceroutings.controller.devfile.io && oc delete customresourcedefinitions.apiextensions.k8s.io devworkspaces.workspace.devfile.io && oc delete customresourcedefinitions.apiextensions.k8s.io devworkspacetemplates.workspace.devfile.io && oc delete customresourcedefinitions.apiextensions.k8s.io devworkspaceoperatorconfigs.controller.devfile.io`

+
[WARNING]
====
The {devworkspace} Operator provides Custom Resource Definitions (CRDs) that use conversion webhooks. Failing to remove these CRDs can cause issues in the cluster.
====

. Verify that all related Custom Resource Definitions are removed:

+
`$ oc get customresourcedefinitions.apiextensions.k8s.io | grep "devfile.io"`

+
This command must display no results.

. Remove the `devworkspace-webhook-server` deployment, mutating, and validating webhooks:

+
`$ oc delete deployment/devworkspace-webhook-server -n openshift-operators && oc delete mutatingwebhookconfigurations controller.devfile.io && oc delete validatingwebhookconfigurations controller.devfile.io`

. Remove any remaining Services, Secrets, and ConfigMaps:

+
`$ oc delete all --selector app.kubernetes.io/part-of=devworkspace-operator,app.kubernetes.io/name=devworkspace-webhook-server -n openshift-operators && oc delete serviceaccounts devworkspace-webhook-server -n openshift-operators && oc delete configmap devworkspace-controller -n openshift-operators && oc delete clusterrole devworkspace-webhook-server devworkspace-controller-metrics-reader devworkspace-controller-edit-workspaces devworkspace-controller-view-workspaces && oc delete clusterrolebinding devworkspace-webhook-server`

+
Depending on the installation, some resources included in the command may not exist in the cluster.

. In the OpenShift web console, complete the uninstallation by going to menu:Administrator[Operators>Installed Operators>{devworkspace} Operator>⋮>Uninstall Operator>Uninstall].