From 0f604610089021d9c642b70d174691382937d2f5 Mon Sep 17 00:00:00 2001 From: Mark Bishop Date: Tue, 2 Oct 2018 14:26:49 -0700 Subject: [PATCH] removing import info. updating removed components table --- .../rancher-cluster-nodes/_index.md | 82 +++---------------- 1 file changed, 10 insertions(+), 72 deletions(-) diff --git a/content/rancher/v2.x/en/admin-settings/removing-rancher/rancher-cluster-nodes/_index.md b/content/rancher/v2.x/en/admin-settings/removing-rancher/rancher-cluster-nodes/_index.md index a2526baa092..d20733e6422 100644 --- a/content/rancher/v2.x/en/admin-settings/removing-rancher/rancher-cluster-nodes/_index.md +++ b/content/rancher/v2.x/en/admin-settings/removing-rancher/rancher-cluster-nodes/_index.md @@ -3,12 +3,7 @@ title: Removing Rancher from Rancher Server Nodes weight: 2000 --- -When you no longer have use for Rancher in your [installation cluster]({{< baseurl >}}/rancher/v2.x/en/installation/ha/), and you want to remove Rancher from its nodes, follow one of the sets of instructions below based on your [cluster type]({{< baseurl >}}/rancher/v2.x/en/cluster-provisioning/#cluster-creation-options). The method you'll use to remove Rancher changes based on the type of cluster. - - -## Nodes Launched by RKE / Nodes Hosted by a Provider - -For clusters nodes provisioned using [RKE](({{< baseurl >}}/rancher/v2.x/en/cluster-provisioning/rke-clusters/)) or a [hosted Kubernetes provider]({{< baseurl >}}/rancher/v2.x/en/cluster-provisioning/#hosted-kubernetes-cluster), you can remove Rancher by downloading and running the Rancher system-tools. +When you want to remove Rancher from your [installation cluster]({{< baseurl >}}/rancher/v2.x/en/installation/ha/) as part of a Rancher reinstall (or uninstall), follow the instructions below to download and run _system-tools_, a utility that removes all Rancher components from Rancher Server nodes provisioned by RKE. ### Download and Configuration @@ -63,77 +58,20 @@ When you run this command, the components listed in [What Gets Removed?](#what-g | `--namespace , -n cattle-system` | Rancher 2.x deployment namespace (``). If no namespace is defined, the options defaults to `cattle-system`. | | `--force` | Skips the the interactive removal confirmation and removes the Rancher deployment without prompt. | -## Imported Cluster Nodes - -For imported clusters, the process for removing Rancher from its nodes is a little different. You can the option of simply deleting the cluster in the Rancher UI, or your can run a script that removes Rancher components from the nodes. Both options make the same deletions. - -{{% tabs %}} -{{% tab "By UI / API" %}} ->**Warning:** This process will remove data from your nodes. Make sure you have created a backup of files you want to keep before executing the command, as data will be lost. - -After you initiate the removal of an [imported cluster]({{< baseurl >}}/rancher/v2.x/en/cluster-provisioning/#import-existing-cluster) using the Rancher UI (or API), the following events occur. - -1. Rancher creates a `serviceAccount` that it uses to remove the cluster. This account is assigned the [clusterRole](https://kubernetes.io/docs/reference/access-authn-authz/rbac/#role-and-clusterrole) and [clusterRoleBinding](https://kubernetes.io/docs/reference/access-authn-authz/rbac/#rolebinding-and-clusterrolebinding) permissions, which are required to remove the cluster. - -1. Using the `serviceAccount`, Rancher schedules and runs a [job](https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/) that cleans the Rancher and Kubernetes components off of the node. This job also references the `serviceAccount` and its roles as dependencies, so the job deletes them before its completion. - -1. Rancher is removed from the cluster nodes. However, the cluster persists, running the native version of Kubernetes. - - **Result:** All components listed for imported clusters in [What Gets Removed?](#what-gets-removed) are deleted. - -{{% /tab %}} -{{% tab "By Script" %}} -Rather than cleaning imported cluster nodes using the Rancher UI, you can run a script instead. - ->**Prerequisite:** -> ->Install [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/). - -1. Open a web browser, navigate to [GitHub](https://github.com/rancher/rancher/blob/master/cleanup/user-cluster.sh), and download `user-cluster.sh`. - -1. Make the script executable by running the following command from the same directory as `user-cluster.sh`: - - ``` - chmod +x user-cluster.sh - ``` - -1. **Air Gap Users Only:** Open `user-cluster.sh` and replace `yaml_url` with the URL in `user-cluster.yml`. - - If you aren't an air gap user, skip this step. - -1. From the same directory, run the script: - - >**Tip:** - > - >Add the `-dry-run` flag to preview the script's outcome without making changes. - - ``` - ./user-cluster.sh rancher/agent:latest - ``` - -**Result:** The script runs. All components listed for imported clusters in [What Gets Removed?](#what-gets-removed) are deleted. - -{{% /tab %}} -{{% /tabs %}} ## What Gets Removed? -When cleaning nodes provisioned using Rancher, the following components are deleted based on the type of cluster node you're removing. +When removing Rancher from server nodes provisioned using RKE, the following components are deleted. -| Removed Component | [IaaS Nodes][1] | [Custom Nodes][2] | [Hosted Cluster][3] | [Imported Nodes][4] | -| ------------------------------------------------------------------------------ | --------------- | ----------------- | ------------------- | ------------------- | -| The Rancher deployment namespace (`cattle-system` by default) | ✓ | ✓ | ✓ | ✓ | -| `serviceAccount`, `clusterRoles`, and `clusterRoleBindings` labeled by Rancher | ✓ | ✓ | ✓ | ✓ | -| Labels, Annotations, and Finalizers | ✓ | ✓ | ✓ | ✓ | -| Rancher Deployment | ✓ | ✓ | ✓ | | -| Machines, clusters, projects, and user custom resource deployments (CRDs) | ✓ | ✓ | ✓ | | -| All resources create under the `management.cattle.io` API Group | ✓ | ✓ | ✓ | | -| All CRDs created by Rancher v2.0.x | ✓ | ✓ | ✓ | | -[1]: {{< baseurl >}}/rancher/v2.x/en/cluster-provisioning/rke-clusters/node-pools/ -[2]: {{< baseurl >}}/rancher/v2.x/en/cluster-provisioning/rke-clusters/custom-nodes/ -[3]: {{< baseurl >}}/rancher/v2.x/en/cluster-provisioning/hosted-kubernetes-clusters/ -[4]: {{< baseurl >}}/rancher/v2.x/en/cluster-provisioning/imported-clusters/ +- The Rancher deployment namespace (`cattle-system` by default). +- `serviceAccount`, `clusterRoles`, and `clusterRoleBindings` labeled by Rancher. +- Labels, Annotations, and Finalizers. +- Rancher Deployment. +- Machines, clusters, projects, and user custom resource deployments (CRDs). +- All resources create under the `management.cattle.io` API Group. +- All CRDs created by Rancher v2.0.x. + >**Using 2.0.8 or Earlier?** >