From 5025a71f5d10d47d9f868dea38ab31083ba9e159 Mon Sep 17 00:00:00 2001 From: Mark Bishop Date: Fri, 14 Sep 2018 17:20:09 -0700 Subject: [PATCH 01/12] initial commit for removing rancher from imported clusters --- .../admin-settings/removing-rancher/_index.md | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 content/rancher/v2.x/en/admin-settings/removing-rancher/_index.md diff --git a/content/rancher/v2.x/en/admin-settings/removing-rancher/_index.md b/content/rancher/v2.x/en/admin-settings/removing-rancher/_index.md new file mode 100644 index 00000000000..99def8d7d57 --- /dev/null +++ b/content/rancher/v2.x/en/admin-settings/removing-rancher/_index.md @@ -0,0 +1,30 @@ +--- +title: Removing Rancher +weight: 2000 +draft: true +--- + +## Removing Rancher From Nodes + +### Hosted Kubernetes Providers + +### Nodes Hosted by IaaS + +### Custom Nodes + +### Imported Cluster + +After you initiate the removal of an imported 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. This process: + + - Removes the `cattle-system` namespace from the cluster. + - Cleans up all remaining namespaces in the cluster (i.e., removes finalizers, annotations, and labels) + + >**Using 2.0.7 or Earlier?** + > + >These versions of Rancher do not automatically delete the `serviceAccount`, `clusterRole`, and `clusterRole` resources after the job runs. You'll have to delete them yourself. + +1. Rancher is removed from the cluster nodes. However, the cluster persists, running the native version of Kubernetes. \ No newline at end of file From dcb810676ce649f9c67267edeef627825c5a3d06 Mon Sep 17 00:00:00 2001 From: Mark Bishop Date: Mon, 17 Sep 2018 15:30:07 -0700 Subject: [PATCH 02/12] adding more content about script --- .../admin-settings/removing-rancher/_index.md | 48 ++++++++++++++- .../removing-rancher/user-cluster.sh | 61 +++++++++++++++++++ 2 files changed, 107 insertions(+), 2 deletions(-) create mode 100644 content/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster.sh diff --git a/content/rancher/v2.x/en/admin-settings/removing-rancher/_index.md b/content/rancher/v2.x/en/admin-settings/removing-rancher/_index.md index 99def8d7d57..1994c8ecec9 100644 --- a/content/rancher/v2.x/en/admin-settings/removing-rancher/_index.md +++ b/content/rancher/v2.x/en/admin-settings/removing-rancher/_index.md @@ -14,6 +14,8 @@ draft: true ### Imported Cluster +{{% tabs %}} +{{% tab "By UI / API" %}} After you initiate the removal of an imported 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. @@ -21,10 +23,52 @@ After you initiate the removal of an imported cluster using the Rancher UI (or A 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. This process: - Removes the `cattle-system` namespace from the cluster. - - Cleans up all remaining namespaces in the cluster (i.e., removes finalizers, annotations, and labels) + - Removes the `serviceAccount`, `clusterRole`, and `clusterRole` resources. + - Cleans up all remaining namespaces in the cluster (i.e., removes finalizers, annotations, and labels). >**Using 2.0.7 or Earlier?** > >These versions of Rancher do not automatically delete the `serviceAccount`, `clusterRole`, and `clusterRole` resources after the job runs. You'll have to delete them yourself. -1. Rancher is removed from the cluster nodes. However, the cluster persists, running the native version of Kubernetes. \ No newline at end of file +1. Rancher is removed from the cluster nodes. However, the cluster persists, running the native version of Kubernetes. +{{% /tab %}} +{{% tab "By Script" %}} +Rather than cleaning + +>**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. Open kubectl. + +1. Using kubectl, 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 + ``` + + + +{{% /tab %}} + +{{% /tabs %}} + + + +### \ No newline at end of file diff --git a/content/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster.sh b/content/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster.sh new file mode 100644 index 00000000000..2b5bc2e7aac --- /dev/null +++ b/content/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster.sh @@ -0,0 +1,61 @@ +#!/bin/bash +# set -x +set -e + +# Location of the yaml to use to deploy the cleanup job +yaml_url=https://raw.githubusercontent.com/rancher/rancher/master/cleanup/user-cluster.yml + +# 120 is equal to a minute as the sleep is half a second +timeout=120 + +# Agent image to use in the yaml file +agent_image="$1" + +show_usage() { + echo -e "Usage: $0 [AGENT_IMAGE] [FLAGS]" + echo "AGENT_IMAGE is a required argument" + echo "" + echo "Flags:" + echo -e "\t-dry-run Display the resources that would will be updated without making changes" +} + +if [ $# -lt 1 ] +then + show_usage + exit 1 +fi + +if [[ $1 == "-h" ||$1 == "--help" ]] +then + show_usage + exit 0 +fi + +# Pull the yaml and replace the agent_image holder with the passed in image +yaml=$(curl --insecure -sfL $yaml_url | sed -e 's=agent_image='"$agent_image"'=') + +if [ "$2" = "-dry-run" ] +then + # Uncomment the env var for dry-run mode + yaml=$(sed -e 's/# // ' <<< "$yaml") +fi + +echo "$yaml" | kubectl --kubeconfig ~/development/kube_config_cluster.yml apply -f - + +# Get the pod ID to tail the logs +pod_id=$(kubectl --kubeconfig ~/development/kube_config_cluster.yml get pod -l job-name=cattle-cleanup-job -o jsonpath="{.items[0].metadata.name}") + +declare -i count=0 +until kubectl --kubeconfig ~/development/kube_config_cluster.yml logs $pod_id -f +do + if [ $count -gt $timeout ] + then + echo "Timout reached, check the job by running kubectl get jobs" + exit 1 + fi + sleep 0.5 + count+=1 +done + +# Cleanup after it completes successfully +echo "$yaml" | kubectl --kubeconfig ~/development/kube_config_cluster.yml delete -f - \ No newline at end of file From 15ab2ecded0d2420a0ae6cf4696ebf049baac63e Mon Sep 17 00:00:00 2001 From: Mark Bishop Date: Wed, 19 Sep 2018 17:41:19 -0700 Subject: [PATCH 03/12] adding more content about deleting rancher from cluster nodes --- .../admin-settings/removing-rancher/_index.md | 54 ++++++++++++++++--- 1 file changed, 46 insertions(+), 8 deletions(-) diff --git a/content/rancher/v2.x/en/admin-settings/removing-rancher/_index.md b/content/rancher/v2.x/en/admin-settings/removing-rancher/_index.md index 1994c8ecec9..ddbb1650f56 100644 --- a/content/rancher/v2.x/en/admin-settings/removing-rancher/_index.md +++ b/content/rancher/v2.x/en/admin-settings/removing-rancher/_index.md @@ -1,22 +1,61 @@ --- -title: Removing Rancher +title: Removing Rancher from Nodes weight: 2000 draft: true --- -## Removing Rancher From Nodes -### Hosted Kubernetes Providers +When you no longer have use for Rancher within a cluster and want to remove the Rancher management plane from your 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 Hosted by IaaS +## Hosted Kubernetes Providers -### Custom Nodes +To remove Rancher from [nodes hosted on a Kubernetes Provider]({{< baseurl >}}/rancher/v2.x/en/cluster-provisioning/#hosted-kubernetes-cluster), simply delete them from Rancher. The cluster will remove Rancher components through the Norman API (Rancher's API framework). -### Imported Cluster + + +## Nodes Launched by RKE + +For cluster nodes launched by RKE (i.e. nodes [hosted by an IaaS]({{< baseurl >}}/rancher/v2.x/en/cluster-provisioning/#node-pools) or [custom nodes]({{< baseurl >}}/rancher/v2.x/en/cluster-provisioning/#custom-nodes)), you can remove the Rancher management plane by downloading and running the [system-tools](https://github.com/rancher/system-tools/releases) for Rancher. + +Running system-tools removes the following Rancher components from your nodes: + +- The Rancher deployment. +- ClusterRoles and ClusterRoleBindings labeled by Rancher. +- Labels, annotations and finalizers from all resources on the management plane cluster. +- Machines, clusters, projects, and user custom resource definitions (CRDs) and corresponding namespaces. +- All resources created under the `management.cattle.io` API group. +- All CRDs created by Rancher 2.x. +- The Rancher deployment namespace, (i.e `cattle-system`). + +### Using the System-Tool + +System-tool is a utility that cleans up rancher projects. In this use case, it will help you remove the Rancher management plane from one of your cluster nodes. + +#### Usage + +>**Warning:** This command 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. + +``` +system-tools remove [command options] [arguments...] +``` + + + +##### Options + +| Option | Description | +| ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `--kubeconfig <$KUBECONFIG>, -c <$KUBECONFIG>` | The cluster's kubeconfig file absolute path (`<$KUBECONFIG>`). | +| `--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 {{% tabs %}} {{% tab "By UI / API" %}} -After you initiate the removal of an imported cluster using the Rancher UI (or API), the following events occur. +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. + +>**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. 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. @@ -71,4 +110,3 @@ Rather than cleaning -### \ No newline at end of file From 70792f049e90abb9ed0edc55823f028ee1a2641a Mon Sep 17 00:00:00 2001 From: Mark Bishop Date: Thu, 20 Sep 2018 12:42:28 -0700 Subject: [PATCH 04/12] Moving faq node cleaning to admin section --- .../admin-settings/removing-rancher/_index.md | 112 ++---------------- .../rancher-cluster-nodes}/_index.md | 31 ++--- .../user-cluster-nodes/_index.md | 104 ++++++++++++++++ 3 files changed, 127 insertions(+), 120 deletions(-) rename content/rancher/v2.x/en/{faq/cleaning-cluster-nodes => admin-settings/removing-rancher/rancher-cluster-nodes}/_index.md (90%) create mode 100644 content/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster-nodes/_index.md diff --git a/content/rancher/v2.x/en/admin-settings/removing-rancher/_index.md b/content/rancher/v2.x/en/admin-settings/removing-rancher/_index.md index ddbb1650f56..fb3699d568e 100644 --- a/content/rancher/v2.x/en/admin-settings/removing-rancher/_index.md +++ b/content/rancher/v2.x/en/admin-settings/removing-rancher/_index.md @@ -1,112 +1,14 @@ --- -title: Removing Rancher from Nodes -weight: 2000 -draft: true +title: Removing Rancher +weight: 5000 --- +There are two contexts in which you'd remove Rancher from a Kubernetes cluster node. -When you no longer have use for Rancher within a cluster and want to remove the Rancher management plane from your 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. - -## Hosted Kubernetes Providers - -To remove Rancher from [nodes hosted on a Kubernetes Provider]({{< baseurl >}}/rancher/v2.x/en/cluster-provisioning/#hosted-kubernetes-cluster), simply delete them from Rancher. The cluster will remove Rancher components through the Norman API (Rancher's API framework). - - - -## Nodes Launched by RKE - -For cluster nodes launched by RKE (i.e. nodes [hosted by an IaaS]({{< baseurl >}}/rancher/v2.x/en/cluster-provisioning/#node-pools) or [custom nodes]({{< baseurl >}}/rancher/v2.x/en/cluster-provisioning/#custom-nodes)), you can remove the Rancher management plane by downloading and running the [system-tools](https://github.com/rancher/system-tools/releases) for Rancher. - -Running system-tools removes the following Rancher components from your nodes: - -- The Rancher deployment. -- ClusterRoles and ClusterRoleBindings labeled by Rancher. -- Labels, annotations and finalizers from all resources on the management plane cluster. -- Machines, clusters, projects, and user custom resource definitions (CRDs) and corresponding namespaces. -- All resources created under the `management.cattle.io` API group. -- All CRDs created by Rancher 2.x. -- The Rancher deployment namespace, (i.e `cattle-system`). - -### Using the System-Tool - -System-tool is a utility that cleans up rancher projects. In this use case, it will help you remove the Rancher management plane from one of your cluster nodes. - -#### Usage - ->**Warning:** This command 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. - -``` -system-tools remove [command options] [arguments...] -``` - - - -##### Options - -| Option | Description | -| ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | -| `--kubeconfig <$KUBECONFIG>, -c <$KUBECONFIG>` | The cluster's kubeconfig file absolute path (`<$KUBECONFIG>`). | -| `--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 - -{{% tabs %}} -{{% tab "By UI / API" %}} -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. - ->**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. - -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. This process: - - - Removes the `cattle-system` namespace from the cluster. - - Removes the `serviceAccount`, `clusterRole`, and `clusterRole` resources. - - Cleans up all remaining namespaces in the cluster (i.e., removes finalizers, annotations, and labels). - - >**Using 2.0.7 or Earlier?** - > - >These versions of Rancher do not automatically delete the `serviceAccount`, `clusterRole`, and `clusterRole` resources after the job runs. You'll have to delete them yourself. - -1. Rancher is removed from the cluster nodes. However, the cluster persists, running the native version of Kubernetes. -{{% /tab %}} -{{% tab "By Script" %}} -Rather than cleaning - ->**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. Open kubectl. - -1. Using kubectl, 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 - ``` - - - -{{% /tab %}} - -{{% /tabs %}} +- [Removing Rancher from Your Rancher Cluster Nodes]({{< baseurl >}}/rancher/v2.x/en/admin-settings/removing-rancher/rancher-cluster-nodes/) + In this context, you are removing Rancher from the Kubernetes cluster that your configured for your Rancher installation. +- [Removing Rancher from User Cluster Nodes]({{< baseurl >}}/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster-nodes/) + In this context, you are removing Rancher from Kubernetes clusters that you provisioned using Rancher. \ No newline at end of file diff --git a/content/rancher/v2.x/en/faq/cleaning-cluster-nodes/_index.md b/content/rancher/v2.x/en/admin-settings/removing-rancher/rancher-cluster-nodes/_index.md similarity index 90% rename from content/rancher/v2.x/en/faq/cleaning-cluster-nodes/_index.md rename to content/rancher/v2.x/en/admin-settings/removing-rancher/rancher-cluster-nodes/_index.md index 54526a4dffa..f2b607d2602 100644 --- a/content/rancher/v2.x/en/faq/cleaning-cluster-nodes/_index.md +++ b/content/rancher/v2.x/en/admin-settings/removing-rancher/rancher-cluster-nodes/_index.md @@ -1,17 +1,18 @@ --- -title: Cleaning cluster nodes +title: Removing Rancher from Your Rancher Cluster Nodes weight: 375 aliases: - /rancher/v2.x/en/installation/removing-rancher/cleaning-cluster-nodes/ - /rancher/v2.x/en/installation/removing-rancher/ + - /rancher/v2.x/en/faq/cleaning-cluster-nodes --- When adding a node to a cluster, resources (containers/(virtual) network interfaces) and configuration items (certificates/configuration files) are created. When removing a node from a cluster (if it is in `Active` state), those resources will be automatically cleaned and the only action needed is to restart the node. When a node has become unreachable and the automatic cleanup process cannot be used, we describe the steps that need to be executed before the node can be added to a cluster again. -## Removing a node from a cluster via Rancher UI +## Removing A Node from a Cluster by Rancher UI When the node is in `Active` state, removing the node from a cluster will trigger a process to clean up the node. Please restart the node after the automatic cleanup process is done to make sure any non-persistent data is properly removed. -* How to restart a node +**To restart a node:** ``` # using reboot @@ -21,17 +22,17 @@ reboot shutdown -r now ``` -## Cleaning a node manually +## Cleaning a Node Manually When a node is unreachable and removed from the cluster, the automatic cleaning process can't be triggered because the node is unreachable. Please follow the steps below to manually clean the node. >**Warning:** The commands listed below will remove data from the node. Make sure you have created a backup of files you want to keep before executing any of the commands as data will be lost. -### Docker containers, images and volumes +### Docker Containers, Images, and Volumes Based on what role you assigned to the node, Kubernetes components in containers, containers belonging to overlay networking, DNS, ingress controller and Rancher agent. (and pods you created that have been scheduled to this node) -* How to clean all Docker containers, images and volumes: +**To clean all Docker containers, images and volumes:** ``` docker rm -f $(docker ps -qa) @@ -49,13 +50,13 @@ Mounts | `/var/lib/kubelet` | `/var/lib/rancher` | -* How to unmount all mounts: +**To unmount all mounts:** ``` for mount in $(mount | grep tmpfs | grep '/var/lib/kubelet' | awk '{ print $3 }') /var/lib/kubelet /var/lib/rancher; do umount $mount; done ``` -### Directories and files +### Directories and Files The following directories are used when adding a node to a cluster, and should be removed. You can remove a directory using `rm -rf /directory_name`. @@ -80,7 +81,7 @@ Directories | `/var/log/pods` | `/var/run/calico` | -* How to clean the directories: +**To clean the directories:** ``` rm -rf /etc/ceph \ @@ -101,13 +102,13 @@ rm -rf /etc/ceph \ /var/run/calico ``` -### Network interfaces and iptables +### Network Interfaces and Iptables The remaining two components that are changed/configured are (virtual) network interfaces and iptables rules. Both are non-persistent to the node, meaning that they will be cleared after a restart of the node. This is the recommended method. -* How to restart a node +**To restart a node:** ``` # using reboot @@ -119,7 +120,7 @@ shutdown -r now If you want to know more on (virtual) network interfaces or iptables rules, please see the specific subjects below. -### Network interfaces +### Network Interfaces >**Note:** Depending on the network provider configured for the cluster the node was part of, some of the interfaces will or won't be present on the node. @@ -131,7 +132,7 @@ Interfaces | `caliXXXXXXXXXXX` (random interface names) | `vethXXXXXXXX` (random interface names) | -* How to list all interfaces: +**To list all interfaces:** ``` # Using ip @@ -141,7 +142,7 @@ ip address show ifconfig -a ``` -* How to remove an interface: +*To remove an interface:* ``` ip link delete interface_name @@ -180,7 +181,7 @@ Chains | `KUBE-SERVICES` | `KUBE-SVC-XXXXXXXXXXXXXXXX` (random chain names) | -* How to list all iptables rules +**To list all iptables rules:** ``` iptables -L -t nat diff --git a/content/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster-nodes/_index.md b/content/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster-nodes/_index.md new file mode 100644 index 00000000000..ec62b91f42d --- /dev/null +++ b/content/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster-nodes/_index.md @@ -0,0 +1,104 @@ +--- +title: Removing Rancher from User Cluster Nodes +weight: 2000 +draft: true +--- + + +When you no longer have use for Rancher in a cluster that you've [provisioned using Rancher]({{< baseurl >}}rancher/v2.x/en/cluster-provisioning/#cluster-creation-in-rancher), 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. + +## Hosted Kubernetes Providers + +To remove Rancher from , simply delete them from Rancher. The cluster will remove Rancher components through the Norman API (Rancher's API framework). + + + +## Nodes Launched by RKE / Nodes Hosted by a Provider + +For clusters nodes provisioned using the following options, you can remove Rancher by downloading and running the Rancher [system-tools](https://github.com/rancher/system-tools/releases): + +- [Nodes hosted by an IaaS]({{< baseurl >}}/rancher/v2.x/en/cluster-provisioning/#node-pools) +- [Custom nodes]({{< baseurl >}}/rancher/v2.x/en/cluster-provisioning/#custom-nodes) +- [Nodes hosted by a Kubernetes Provider]({{< baseurl >}}/rancher/v2.x/en/cluster-provisioning/#hosted-kubernetes-cluster) + +### Using the System-Tool + +System-tool is a utility that cleans up rancher projects. In this use case, it will help you remove the Rancher management plane from your cluster nodes. + +#### Usage + +>**Warning:** This command 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. + +``` +system-tools remove [command options] [arguments...] +``` + +##### Options + +| Option | Description | +| ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `--kubeconfig <$KUBECONFIG>, -c <$KUBECONFIG>` | The cluster's kubeconfig file absolute path (`<$KUBECONFIG>`). | +| `--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 + +{{% tabs %}} +{{% tab "By UI / API" %}} +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. + +>**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. + +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. This process: + + - Removes the `cattle-system` namespace from the cluster. + - Removes the `serviceAccount`, `clusterRole`, and `clusterRole` resources. + - Cleans up all remaining namespaces in the cluster (i.e., removes finalizers, annotations, and labels). + + >**Using 2.0.7 or Earlier?** + > + >These versions of Rancher do not automatically delete the `serviceAccount`, `clusterRole`, and `clusterRole` resources after the job runs. You'll have to delete them yourself. + +1. Rancher is removed from the cluster nodes. However, the cluster persists, running the native version of Kubernetes. +{{% /tab %}} +{{% tab "By Script" %}} +Rather than cleaning + +>**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. Open kubectl. + +1. Using kubectl, 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 + ``` + + + +{{% /tab %}} + +{{% /tabs %}} + + + From b8f2851816ea08099439b957e3f5250ce4ba3a2b Mon Sep 17 00:00:00 2001 From: Mark Bishop Date: Thu, 20 Sep 2018 15:29:35 -0700 Subject: [PATCH 05/12] drafted, but still missing instructions on how to obtain/run system-tools --- .../admin-settings/removing-rancher/_index.md | 3 + .../rancher-cluster-nodes/_index.md | 8 ++- .../user-cluster-nodes/_index.md | 63 +++++++++++-------- .../removing-rancher/user-cluster.sh | 61 ------------------ 4 files changed, 45 insertions(+), 90 deletions(-) delete mode 100644 content/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster.sh diff --git a/content/rancher/v2.x/en/admin-settings/removing-rancher/_index.md b/content/rancher/v2.x/en/admin-settings/removing-rancher/_index.md index fb3699d568e..62f8483fbea 100644 --- a/content/rancher/v2.x/en/admin-settings/removing-rancher/_index.md +++ b/content/rancher/v2.x/en/admin-settings/removing-rancher/_index.md @@ -1,8 +1,11 @@ --- title: Removing Rancher weight: 5000 +draft: true --- +When you deploy Rancher and use it to provision clusters, Rancher installs its components on the nodes you use. This section features instructions on how to clean Rancher's components from your nodes that you no longer want to use with Rancher. + There are two contexts in which you'd remove Rancher from a Kubernetes cluster node. - [Removing Rancher from Your Rancher Cluster Nodes]({{< baseurl >}}/rancher/v2.x/en/admin-settings/removing-rancher/rancher-cluster-nodes/) 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 f2b607d2602..8f8f5eaf7aa 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 @@ -4,9 +4,11 @@ weight: 375 aliases: - /rancher/v2.x/en/installation/removing-rancher/cleaning-cluster-nodes/ - /rancher/v2.x/en/installation/removing-rancher/ - - /rancher/v2.x/en/faq/cleaning-cluster-nodes + - /rancher/v2.x/en/faq/cleaning-cluster-nodes/ --- -When adding a node to a cluster, resources (containers/(virtual) network interfaces) and configuration items (certificates/configuration files) are created. When removing a node from a cluster (if it is in `Active` state), those resources will be automatically cleaned and the only action needed is to restart the node. When a node has become unreachable and the automatic cleanup process cannot be used, we describe the steps that need to be executed before the node can be added to a cluster again. +When you deploy Rancher to the Kubernetes nodes that host your [Rancher installation]({{< baseurl >}}/rancher/v2.x/en/installation/), resources (containers/virtual network interfaces) and configuration items (certificates/configuration files) are created. + +When removing nodes from your installation cluster (provided that they are in `Active` state), those resources automatically cleaned, and the only action needed is to restart the node. When a node has become unreachable and the automatic cleanup process cannot be used, we describe the steps that need to be executed before the node can be added to a cluster again. ## Removing A Node from a Cluster by Rancher UI @@ -142,7 +144,7 @@ ip address show ifconfig -a ``` -*To remove an interface:* +**To remove an interface:** ``` ip link delete interface_name diff --git a/content/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster-nodes/_index.md b/content/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster-nodes/_index.md index ec62b91f42d..12648c6e743 100644 --- a/content/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster-nodes/_index.md +++ b/content/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster-nodes/_index.md @@ -7,23 +7,14 @@ draft: true When you no longer have use for Rancher in a cluster that you've [provisioned using Rancher]({{< baseurl >}}rancher/v2.x/en/cluster-provisioning/#cluster-creation-in-rancher), 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. -## Hosted Kubernetes Providers - -To remove Rancher from , simply delete them from Rancher. The cluster will remove Rancher components through the Norman API (Rancher's API framework). - - ## Nodes Launched by RKE / Nodes Hosted by a Provider -For clusters nodes provisioned using the following options, you can remove Rancher by downloading and running the Rancher [system-tools](https://github.com/rancher/system-tools/releases): - -- [Nodes hosted by an IaaS]({{< baseurl >}}/rancher/v2.x/en/cluster-provisioning/#node-pools) -- [Custom nodes]({{< baseurl >}}/rancher/v2.x/en/cluster-provisioning/#custom-nodes) -- [Nodes hosted by a Kubernetes Provider]({{< baseurl >}}/rancher/v2.x/en/cluster-provisioning/#hosted-kubernetes-cluster) +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](https://github.com/rancher/system-tools/releases): ### Using the System-Tool -System-tool is a utility that cleans up rancher projects. In this use case, it will help you remove the Rancher management plane from your cluster nodes. +System-tools is a utility that cleans up Rancher. In this use case, it will help you remove the Rancher from your cluster nodes. #### Usage @@ -33,6 +24,10 @@ System-tool is a utility that cleans up rancher projects. In this use case, it w system-tools remove [command options] [arguments...] ``` +
+When you run this command, the components listed in [What Gets Removed?](#what-gets-removed) are deleted. + + ##### Options | Option | Description | @@ -41,30 +36,27 @@ system-tools remove [command options] [arguments...] | `--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 +## 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" %}} -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. - >**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. This process: - - - Removes the `cattle-system` namespace from the cluster. - - Removes the `serviceAccount`, `clusterRole`, and `clusterRole` resources. - - Cleans up all remaining namespaces in the cluster (i.e., removes finalizers, annotations, and labels). +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. - >**Using 2.0.7 or Earlier?** - > - >These versions of Rancher do not automatically delete the `serviceAccount`, `clusterRole`, and `clusterRole` resources after the job runs. You'll have to delete them yourself. - 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 +Rather than cleaning imported cluster nodes using the Rancher UI, you can run a script instead. >**Prerequisite:** > @@ -94,11 +86,30 @@ Rather than cleaning ./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. +| 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/ + +>**Using 2.0.7 or Earlier?** +> +>These versions of Rancher do not automatically delete the `serviceAccount`, `clusterRole`, and `clusterRole` resources after the job runs. You'll have to delete them yourself. \ No newline at end of file diff --git a/content/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster.sh b/content/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster.sh deleted file mode 100644 index 2b5bc2e7aac..00000000000 --- a/content/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -# set -x -set -e - -# Location of the yaml to use to deploy the cleanup job -yaml_url=https://raw.githubusercontent.com/rancher/rancher/master/cleanup/user-cluster.yml - -# 120 is equal to a minute as the sleep is half a second -timeout=120 - -# Agent image to use in the yaml file -agent_image="$1" - -show_usage() { - echo -e "Usage: $0 [AGENT_IMAGE] [FLAGS]" - echo "AGENT_IMAGE is a required argument" - echo "" - echo "Flags:" - echo -e "\t-dry-run Display the resources that would will be updated without making changes" -} - -if [ $# -lt 1 ] -then - show_usage - exit 1 -fi - -if [[ $1 == "-h" ||$1 == "--help" ]] -then - show_usage - exit 0 -fi - -# Pull the yaml and replace the agent_image holder with the passed in image -yaml=$(curl --insecure -sfL $yaml_url | sed -e 's=agent_image='"$agent_image"'=') - -if [ "$2" = "-dry-run" ] -then - # Uncomment the env var for dry-run mode - yaml=$(sed -e 's/# // ' <<< "$yaml") -fi - -echo "$yaml" | kubectl --kubeconfig ~/development/kube_config_cluster.yml apply -f - - -# Get the pod ID to tail the logs -pod_id=$(kubectl --kubeconfig ~/development/kube_config_cluster.yml get pod -l job-name=cattle-cleanup-job -o jsonpath="{.items[0].metadata.name}") - -declare -i count=0 -until kubectl --kubeconfig ~/development/kube_config_cluster.yml logs $pod_id -f -do - if [ $count -gt $timeout ] - then - echo "Timout reached, check the job by running kubectl get jobs" - exit 1 - fi - sleep 0.5 - count+=1 -done - -# Cleanup after it completes successfully -echo "$yaml" | kubectl --kubeconfig ~/development/kube_config_cluster.yml delete -f - \ No newline at end of file From d41d5db6d98b45da1577199532b7f1c454ed9654 Mon Sep 17 00:00:00 2001 From: Mark Bishop Date: Fri, 28 Sep 2018 12:00:01 -0700 Subject: [PATCH 06/12] adding more info on how to run system-tools --- .../admin-settings/removing-rancher/_index.md | 1 - .../user-cluster-nodes/_index.md | 29 +++++++++++++++++-- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/content/rancher/v2.x/en/admin-settings/removing-rancher/_index.md b/content/rancher/v2.x/en/admin-settings/removing-rancher/_index.md index 62f8483fbea..6c0f1216291 100644 --- a/content/rancher/v2.x/en/admin-settings/removing-rancher/_index.md +++ b/content/rancher/v2.x/en/admin-settings/removing-rancher/_index.md @@ -1,7 +1,6 @@ --- title: Removing Rancher weight: 5000 -draft: true --- When you deploy Rancher and use it to provision clusters, Rancher installs its components on the nodes you use. This section features instructions on how to clean Rancher's components from your nodes that you no longer want to use with Rancher. diff --git a/content/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster-nodes/_index.md b/content/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster-nodes/_index.md index 12648c6e743..1a30e52eeac 100644 --- a/content/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster-nodes/_index.md +++ b/content/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster-nodes/_index.md @@ -1,7 +1,6 @@ --- title: Removing Rancher from User Cluster Nodes weight: 2000 -draft: true --- @@ -10,7 +9,29 @@ When you no longer have use for Rancher in a cluster that you've [provisioned us ## 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](https://github.com/rancher/system-tools/releases): +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. + +### Download and Configuration + +You can download the latest version of Rancher system-tools from its GitHub [releases page](https://github.com/rancher/system-tools/releases). Download the version of system-tools for the OS that you're removing Rancher from. + +Operating System | File +-----------------|----- +MacOS | `system-tools_darwin-amd64` +Linux | `system-tools_linux-amd64` +Windows | `system-tools_windows-amd64.exe` + +
+ +After you download the tools, move it onto the node you're removing Rancher from, and then complete the following actions: + +1. Rename the file to `system-tools`. + +1. Give the file executable permissions by running the following command: + + ``` + chmod +x system-tools + ``` ### Using the System-Tool @@ -18,10 +39,12 @@ System-tools is a utility that cleans up Rancher. In this use case, it will help #### Usage +After you move the `system-tools` file to your Rancher node, you can run it by changing to the file's directory and running the following command. + >**Warning:** This command 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. ``` -system-tools remove [command options] [arguments...] +./system-tools remove --kubeconfig <$KUBECONFIG> --namespace ```
From dfa8f2e20f4183ffb5e41c39debec6c457526c36 Mon Sep 17 00:00:00 2001 From: Mark Bishop Date: Fri, 28 Sep 2018 18:14:33 -0700 Subject: [PATCH 07/12] swapping use cases per Denise and Mohamed --- .../admin-settings/removing-rancher/_index.md | 10 +- .../rancher-cluster-nodes/_index.md | 255 +++++++---------- .../user-cluster-nodes/_index.md | 256 +++++++++++------- 3 files changed, 260 insertions(+), 261 deletions(-) diff --git a/content/rancher/v2.x/en/admin-settings/removing-rancher/_index.md b/content/rancher/v2.x/en/admin-settings/removing-rancher/_index.md index 6c0f1216291..12860637e30 100644 --- a/content/rancher/v2.x/en/admin-settings/removing-rancher/_index.md +++ b/content/rancher/v2.x/en/admin-settings/removing-rancher/_index.md @@ -7,10 +7,10 @@ When you deploy Rancher and use it to provision clusters, Rancher installs its c There are two contexts in which you'd remove Rancher from a Kubernetes cluster node. -- [Removing Rancher from Your Rancher Cluster Nodes]({{< baseurl >}}/rancher/v2.x/en/admin-settings/removing-rancher/rancher-cluster-nodes/) +- [Removing Rancher from Rancher-Provisioned Nodes]({{< baseurl >}}/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster-nodes/) + + In this context, you are removing Rancher from Kubernetes clusters that you provisioned using Rancher. + +- [Removing Rancher from Your Rancher Server Nodes]({{< baseurl >}}/rancher/v2.x/en/admin-settings/removing-rancher/rancher-cluster-nodes/) In this context, you are removing Rancher from the Kubernetes cluster that your configured for your Rancher installation. - -- [Removing Rancher from User Cluster Nodes]({{< baseurl >}}/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster-nodes/) - - In this context, you are removing Rancher from Kubernetes clusters that you provisioned using Rancher. \ No newline at end of file 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 8f8f5eaf7aa..106df64c816 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 @@ -1,192 +1,137 @@ --- -title: Removing Rancher from Your Rancher Cluster Nodes -weight: 375 -aliases: - - /rancher/v2.x/en/installation/removing-rancher/cleaning-cluster-nodes/ - - /rancher/v2.x/en/installation/removing-rancher/ - - /rancher/v2.x/en/faq/cleaning-cluster-nodes/ +title: Removing Rancher from Rancher Server Nodes +weight: 2000 --- -When you deploy Rancher to the Kubernetes nodes that host your [Rancher installation]({{< baseurl >}}/rancher/v2.x/en/installation/), resources (containers/virtual network interfaces) and configuration items (certificates/configuration files) are created. -When removing nodes from your installation cluster (provided that they are in `Active` state), those resources automatically cleaned, and the only action needed is to restart the node. When a node has become unreachable and the automatic cleanup process cannot be used, we describe the steps that need to be executed before the node can be added to a cluster again. +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. -## Removing A Node from a Cluster by Rancher UI -When the node is in `Active` state, removing the node from a cluster will trigger a process to clean up the node. Please restart the node after the automatic cleanup process is done to make sure any non-persistent data is properly removed. +## Nodes Launched by RKE / Nodes Hosted by a Provider -**To restart a node:** +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. + +### Download and Configuration + +You can download the latest version of Rancher system-tools from its GitHub [releases page](https://github.com/rancher/system-tools/releases). Download the version of system-tools for the OS that you're removing Rancher from. + +Operating System | File +-----------------|----- +MacOS | `system-tools_darwin-amd64` +Linux | `system-tools_linux-amd64` +Windows | `system-tools_windows-amd64.exe` + +
+ +After you download the tools, move it onto the node you're removing Rancher from, and then complete the following actions: + +1. Rename the file to `system-tools`. + +1. Give the file executable permissions by running the following command: + + ``` + chmod +x system-tools + ``` + +### Using the System-Tool + +System-tools is a utility that cleans up Rancher. In this use case, it will help you remove the Rancher from your cluster nodes. + +#### Usage + +After you move the `system-tools` file to your Rancher node, you can run it by changing to the file's directory and running the following command. + +>**Warning:** This command 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. ``` -# using reboot -reboot - -# using shutdown -shutdown -r now +./system-tools remove --kubeconfig <$KUBECONFIG> --namespace ``` -## Cleaning a Node Manually +
+When you run this command, the components listed in [What Gets Removed?](#what-gets-removed) are deleted. -When a node is unreachable and removed from the cluster, the automatic cleaning process can't be triggered because the node is unreachable. Please follow the steps below to manually clean the node. ->**Warning:** The commands listed below will remove data from the node. Make sure you have created a backup of files you want to keep before executing any of the commands as data will be lost. +##### Options -### Docker Containers, Images, and Volumes +| Option | Description | +| ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `--kubeconfig <$KUBECONFIG>, -c <$KUBECONFIG>` | The cluster's kubeconfig file absolute path (`<$KUBECONFIG>`). | +| `--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. | -Based on what role you assigned to the node, Kubernetes components in containers, containers belonging to overlay networking, DNS, ingress controller and Rancher agent. (and pods you created that have been scheduled to this node) +## Imported Cluster Nodes -**To clean all Docker containers, images and volumes:** +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. -``` -docker rm -f $(docker ps -qa) -docker rmi -f $(docker images -q) -docker volume rm $(docker volume ls -q) -``` +{{% 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. -### Mounts +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. -Kubernetes components and secrets leave behind mounts on the system that need to be unmounted. +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. -Mounts | ---------| -`/var/lib/kubelet/pods/XXX` (miscellaneous mounts) | -`/var/lib/kubelet` | -`/var/lib/rancher` | +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. -**To unmount all mounts:** + **Result:** All components listed for imported clusters in [What Gets Removed?](#what-gets-removed) are deleted. -``` -for mount in $(mount | grep tmpfs | grep '/var/lib/kubelet' | awk '{ print $3 }') /var/lib/kubelet /var/lib/rancher; do umount $mount; done -``` +{{% /tab %}} +{{% tab "By Script" %}} +Rather than cleaning imported cluster nodes using the Rancher UI, you can run a script instead. -### Directories and Files +>**Prerequisite:** +> +>Install [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/). -The following directories are used when adding a node to a cluster, and should be removed. You can remove a directory using `rm -rf /directory_name`. +1. Open a web browser, navigate to [GitHub](https://github.com/rancher/rancher/blob/master/cleanup/user-cluster.sh), and download `user-cluster.sh`. ->**Note:** Depending on the role you assigned to the node, some of the directories will or won't be present on the node. +1. Open kubectl. -Directories | ---------| -`/etc/ceph` | -`/etc/cni` | -`/etc/kubernetes` | -`/opt/cni` | -`/opt/rke` | -`/run/secrets/kubernetes.io` | -`/run/calico` | -`/run/flannel` | -`/var/lib/calico` | -`/var/lib/etcd` | -`/var/lib/cni` | -`/var/lib/kubelet` | -`/var/lib/rancher/rke/log` | -`/var/log/containers` | -`/var/log/pods` | -`/var/run/calico` | +1. Using kubectl, make the script executable by running the following command from the same directory as `user-cluster.sh`: -**To clean the directories:** + ``` + chmod +x user-cluster.sh + ``` -``` -rm -rf /etc/ceph \ - /etc/cni \ - /etc/kubernetes \ - /opt/cni \ - /opt/rke \ - /run/secrets/kubernetes.io \ - /run/calico \ - /run/flannel \ - /var/lib/calico \ - /var/lib/etcd \ - /var/lib/cni \ - /var/lib/kubelet \ - /var/lib/rancher/rke/log \ - /var/log/containers \ - /var/log/pods \ - /var/run/calico -``` +1. **Air Gap Users Only:** Open `user-cluster.sh` and replace `yaml_url` with the URL in `user-cluster.yml`. -### Network Interfaces and Iptables + If you aren't an air gap user, skip this step. -The remaining two components that are changed/configured are (virtual) network interfaces and iptables rules. Both are non-persistent to the node, meaning that they will be cleared after a restart of the node. +1. From the same directory, run the script: -This is the recommended method. + >**Tip:** + > + >Add the `-dry-run` flag to preview the script's outcome without making changes. -**To restart a node:** + ``` + ./user-cluster.sh rancher/agent:latest + ``` -``` -# using reboot -reboot +**Result:** The script runs. All components listed for imported clusters in [What Gets Removed?](#what-gets-removed) are deleted. + +{{% /tab %}} +{{% /tabs %}} -# using shutdown -shutdown -r now -``` +## What Gets Removed? -If you want to know more on (virtual) network interfaces or iptables rules, please see the specific subjects below. +When cleaning nodes provisioned using Rancher, the following components are deleted based on the type of cluster node you're removing. -### Network Interfaces +| 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 | ✓ | ✓ | ✓ | | ->**Note:** Depending on the network provider configured for the cluster the node was part of, some of the interfaces will or won't be present on the node. +[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/ -Interfaces | ---------| -`flannel.1` | -`cni0` | -`tunl0` | -`caliXXXXXXXXXXX` (random interface names) | -`vethXXXXXXXX` (random interface names) | - -**To list all interfaces:** - -``` -# Using ip -ip address show - -# Using ifconfig -ifconfig -a -``` - -**To remove an interface:** - -``` -ip link delete interface_name -``` - -### Iptables - ->**Note:** Depending on the network provider configured for the cluster the node was part of, some of the chains will or won't be present on the node. - -Iptables rules are used to route traffic from and to containers. The created rules are not persistent, so restarting the node will restore iptables to it's original state. - -Chains | ---------| -`cali-failsafe-in` | -`cali-failsafe-out` | -`cali-fip-dnat` | -`cali-fip-snat` | -`cali-from-hep-forward` | -`cali-from-host-endpoint` | -`cali-from-wl-dispatch` | -`cali-fw-caliXXXXXXXXXXX` (random chain names) | -`cali-nat-outgoing` | -`cali-pri-kns.NAMESPACE` (chain per namespace) | -`cali-pro-kns.NAMESPACE` (chain per namespace) | -`cali-to-hep-forward` | -`cali-to-host-endpoint` | -`cali-to-wl-dispatch` | -`cali-tw-caliXXXXXXXXXXX` (random chain names) | -`cali-wl-to-host` | -`KUBE-EXTERNAL-SERVICES` | -`KUBE-FIREWALL` | -`KUBE-MARK-DROP` | -`KUBE-MARK-MASQ` | -`KUBE-NODEPORTS` | -`KUBE-SEP-XXXXXXXXXXXXXXXX` (random chain names) | -`KUBE-SERVICES` | -`KUBE-SVC-XXXXXXXXXXXXXXXX` (random chain names) | - -**To list all iptables rules:** - -``` -iptables -L -t nat -iptables -L -t mangle -iptables -L -``` +>**Using 2.0.7 or Earlier?** +> +>These versions of Rancher do not automatically delete the `serviceAccount`, `clusterRole`, and `clusterRole` resources after the job runs. You'll have to delete them yourself. \ No newline at end of file diff --git a/content/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster-nodes/_index.md b/content/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster-nodes/_index.md index 1a30e52eeac..f4e67b1346d 100644 --- a/content/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster-nodes/_index.md +++ b/content/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster-nodes/_index.md @@ -1,138 +1,192 @@ --- -title: Removing Rancher from User Cluster Nodes -weight: 2000 +title: Removing Rancher from Rancher-Provisioned Nodes +weight: 375 +aliases: + - /rancher/v2.x/en/installation/removing-rancher/cleaning-cluster-nodes/ + - /rancher/v2.x/en/installation/removing-rancher/ + - /rancher/v2.x/en/faq/cleaning-cluster-nodes/ --- +When you use Rancher to [provision nodes for a cluster]({{< baseurl >}}rancher/v2.x/en/cluster-provisioning/#cluster-creation-in-rancher), resources (containers/virtual network interfaces) and configuration items (certificates/configuration files) are created. +When removing nodes from your Rancher-provisioned cluster (provided that they are in `Active` state), those resources automatically cleaned, and the only action needed is to restart the node. When a node has become unreachable and the automatic cleanup process cannot be used, we describe the steps that need to be executed before the node can be added to a cluster again. -When you no longer have use for Rancher in a cluster that you've [provisioned using Rancher]({{< baseurl >}}rancher/v2.x/en/cluster-provisioning/#cluster-creation-in-rancher), 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. +## Removing A Node from a Cluster by Rancher UI +When the node is in `Active` state, removing the node from a cluster will trigger a process to clean up the node. Please restart the node after the automatic cleanup process is done to make sure any non-persistent data is properly removed. -## 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. - -### Download and Configuration - -You can download the latest version of Rancher system-tools from its GitHub [releases page](https://github.com/rancher/system-tools/releases). Download the version of system-tools for the OS that you're removing Rancher from. - -Operating System | File ------------------|----- -MacOS | `system-tools_darwin-amd64` -Linux | `system-tools_linux-amd64` -Windows | `system-tools_windows-amd64.exe` - -
- -After you download the tools, move it onto the node you're removing Rancher from, and then complete the following actions: - -1. Rename the file to `system-tools`. - -1. Give the file executable permissions by running the following command: - - ``` - chmod +x system-tools - ``` - -### Using the System-Tool - -System-tools is a utility that cleans up Rancher. In this use case, it will help you remove the Rancher from your cluster nodes. - -#### Usage - -After you move the `system-tools` file to your Rancher node, you can run it by changing to the file's directory and running the following command. - ->**Warning:** This command 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. +**To restart a node:** ``` -./system-tools remove --kubeconfig <$KUBECONFIG> --namespace +# using reboot +reboot + +# using shutdown +shutdown -r now ``` -
-When you run this command, the components listed in [What Gets Removed?](#what-gets-removed) are deleted. +## Cleaning a Node Manually +When a node is unreachable and removed from the cluster, the automatic cleaning process can't be triggered because the node is unreachable. Please follow the steps below to manually clean the node. -##### Options +>**Warning:** The commands listed below will remove data from the node. Make sure you have created a backup of files you want to keep before executing any of the commands as data will be lost. -| Option | Description | -| ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | -| `--kubeconfig <$KUBECONFIG>, -c <$KUBECONFIG>` | The cluster's kubeconfig file absolute path (`<$KUBECONFIG>`). | -| `--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. | +### Docker Containers, Images, and Volumes -## Imported Cluster Nodes +Based on what role you assigned to the node, Kubernetes components in containers, containers belonging to overlay networking, DNS, ingress controller and Rancher agent. (and pods you created that have been scheduled to this node) -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. +**To clean all Docker containers, images and volumes:** -{{% 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. +``` +docker rm -f $(docker ps -qa) +docker rmi -f $(docker images -q) +docker volume rm $(docker volume ls -q) +``` -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. +### Mounts -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. +Kubernetes components and secrets leave behind mounts on the system that need to be unmounted. -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. +Mounts | +--------| +`/var/lib/kubelet/pods/XXX` (miscellaneous mounts) | +`/var/lib/kubelet` | +`/var/lib/rancher` | - **Result:** All components listed for imported clusters in [What Gets Removed?](#what-gets-removed) are deleted. +**To unmount all mounts:** -{{% /tab %}} -{{% tab "By Script" %}} -Rather than cleaning imported cluster nodes using the Rancher UI, you can run a script instead. +``` +for mount in $(mount | grep tmpfs | grep '/var/lib/kubelet' | awk '{ print $3 }') /var/lib/kubelet /var/lib/rancher; do umount $mount; done +``` ->**Prerequisite:** -> ->Install [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/). +### Directories and Files -1. Open a web browser, navigate to [GitHub](https://github.com/rancher/rancher/blob/master/cleanup/user-cluster.sh), and download `user-cluster.sh`. +The following directories are used when adding a node to a cluster, and should be removed. You can remove a directory using `rm -rf /directory_name`. -1. Open kubectl. +>**Note:** Depending on the role you assigned to the node, some of the directories will or won't be present on the node. -1. Using kubectl, make the script executable by running the following command from the same directory as `user-cluster.sh`: +Directories | +--------| +`/etc/ceph` | +`/etc/cni` | +`/etc/kubernetes` | +`/opt/cni` | +`/opt/rke` | +`/run/secrets/kubernetes.io` | +`/run/calico` | +`/run/flannel` | +`/var/lib/calico` | +`/var/lib/etcd` | +`/var/lib/cni` | +`/var/lib/kubelet` | +`/var/lib/rancher/rke/log` | +`/var/log/containers` | +`/var/log/pods` | +`/var/run/calico` | - ``` - chmod +x user-cluster.sh - ``` +**To clean the directories:** -1. **Air Gap Users Only:** Open `user-cluster.sh` and replace `yaml_url` with the URL in `user-cluster.yml`. +``` +rm -rf /etc/ceph \ + /etc/cni \ + /etc/kubernetes \ + /opt/cni \ + /opt/rke \ + /run/secrets/kubernetes.io \ + /run/calico \ + /run/flannel \ + /var/lib/calico \ + /var/lib/etcd \ + /var/lib/cni \ + /var/lib/kubelet \ + /var/lib/rancher/rke/log \ + /var/log/containers \ + /var/log/pods \ + /var/run/calico +``` - If you aren't an air gap user, skip this step. +### Network Interfaces and Iptables -1. From the same directory, run the script: +The remaining two components that are changed/configured are (virtual) network interfaces and iptables rules. Both are non-persistent to the node, meaning that they will be cleared after a restart of the node. - >**Tip:** - > - >Add the `-dry-run` flag to preview the script's outcome without making changes. +This is the recommended method. - ``` - ./user-cluster.sh rancher/agent:latest - ``` +**To restart a node:** -**Result:** The script runs. All components listed for imported clusters in [What Gets Removed?](#what-gets-removed) are deleted. - -{{% /tab %}} -{{% /tabs %}} +``` +# using reboot +reboot -## What Gets Removed? +# using shutdown +shutdown -r now +``` -When cleaning nodes provisioned using Rancher, the following components are deleted based on the type of cluster node you're removing. +If you want to know more on (virtual) network interfaces or iptables rules, please see the specific subjects below. -| 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 | ✓ | ✓ | ✓ | | +### Network Interfaces -[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/ +>**Note:** Depending on the network provider configured for the cluster the node was part of, some of the interfaces will or won't be present on the node. ->**Using 2.0.7 or Earlier?** -> ->These versions of Rancher do not automatically delete the `serviceAccount`, `clusterRole`, and `clusterRole` resources after the job runs. You'll have to delete them yourself. \ No newline at end of file +Interfaces | +--------| +`flannel.1` | +`cni0` | +`tunl0` | +`caliXXXXXXXXXXX` (random interface names) | +`vethXXXXXXXX` (random interface names) | + +**To list all interfaces:** + +``` +# Using ip +ip address show + +# Using ifconfig +ifconfig -a +``` + +**To remove an interface:** + +``` +ip link delete interface_name +``` + +### Iptables + +>**Note:** Depending on the network provider configured for the cluster the node was part of, some of the chains will or won't be present on the node. + +Iptables rules are used to route traffic from and to containers. The created rules are not persistent, so restarting the node will restore iptables to it's original state. + +Chains | +--------| +`cali-failsafe-in` | +`cali-failsafe-out` | +`cali-fip-dnat` | +`cali-fip-snat` | +`cali-from-hep-forward` | +`cali-from-host-endpoint` | +`cali-from-wl-dispatch` | +`cali-fw-caliXXXXXXXXXXX` (random chain names) | +`cali-nat-outgoing` | +`cali-pri-kns.NAMESPACE` (chain per namespace) | +`cali-pro-kns.NAMESPACE` (chain per namespace) | +`cali-to-hep-forward` | +`cali-to-host-endpoint` | +`cali-to-wl-dispatch` | +`cali-tw-caliXXXXXXXXXXX` (random chain names) | +`cali-wl-to-host` | +`KUBE-EXTERNAL-SERVICES` | +`KUBE-FIREWALL` | +`KUBE-MARK-DROP` | +`KUBE-MARK-MASQ` | +`KUBE-NODEPORTS` | +`KUBE-SEP-XXXXXXXXXXXXXXXX` (random chain names) | +`KUBE-SERVICES` | +`KUBE-SVC-XXXXXXXXXXXXXXXX` (random chain names) | + +**To list all iptables rules:** + +``` +iptables -L -t nat +iptables -L -t mangle +iptables -L +``` From 78cb1842e3a0c1c74b9255b9f8eab3162dc28441 Mon Sep 17 00:00:00 2001 From: Mark Bishop Date: Tue, 2 Oct 2018 13:44:19 -0700 Subject: [PATCH 08/12] making edit's based on Mohamed's feedback --- .../admin-settings/removing-rancher/_index.md | 2 +- .../rancher-cluster-nodes/_index.md | 23 +++--- .../user-cluster-nodes/_index.md | 73 +++++++++++++++++++ 3 files changed, 87 insertions(+), 11 deletions(-) diff --git a/content/rancher/v2.x/en/admin-settings/removing-rancher/_index.md b/content/rancher/v2.x/en/admin-settings/removing-rancher/_index.md index 12860637e30..535919c18c5 100644 --- a/content/rancher/v2.x/en/admin-settings/removing-rancher/_index.md +++ b/content/rancher/v2.x/en/admin-settings/removing-rancher/_index.md @@ -3,7 +3,7 @@ title: Removing Rancher weight: 5000 --- -When you deploy Rancher and use it to provision clusters, Rancher installs its components on the nodes you use. This section features instructions on how to clean Rancher's components from your nodes that you no longer want to use with Rancher. +When you deploy Rancher and use it to provision clusters, Rancher installs its components on the nodes you use. This section features instructions on how to remove Rancher's components from your nodes that you no longer want to use with Rancher. There are two contexts in which you'd remove Rancher from a Kubernetes cluster node. 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 106df64c816..f475ff885be 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 @@ -12,7 +12,7 @@ For clusters nodes provisioned using [RKE](({{< baseurl >}}/rancher/v2.x/en/clus ### Download and Configuration -You can download the latest version of Rancher system-tools from its GitHub [releases page](https://github.com/rancher/system-tools/releases). Download the version of system-tools for the OS that you're removing Rancher from. +You can download the latest version of Rancher system-tools from its GitHub [releases page](https://github.com/rancher/system-tools/releases). Download the version of system-tools for the OS that you're running the tool from. Operating System | File -----------------|----- @@ -22,7 +22,7 @@ Windows | `system-tools_windows-amd64.exe`
-After you download the tools, move it onto the node you're removing Rancher from, and then complete the following actions: +After you download the tools, complete the following actions: 1. Rename the file to `system-tools`. @@ -31,16 +31,21 @@ After you download the tools, move it onto the node you're removing Rancher from ``` chmod +x system-tools ``` +1. Download the Kubeconfig File for your Rancher installation cluster and place it in the `/.kube/config` on your workstation. System-tools uses this file to access your installation cluster. + For instructions on how to download the Kubeconfig file, see [Accessing Clusters with kubectl and a kubeconfig File]({{< baseurl >}}rancher/v2.x/en/k8s-in-rancher/kubectl/#accessing-clusters-with-kubectl-and-a-kubeconfig-file). + +1. Move `system-tools` to the same directory as the kubeconfig file: `/.kube/config`. + ### Using the System-Tool -System-tools is a utility that cleans up Rancher. In this use case, it will help you remove the Rancher from your cluster nodes. +System-tools is a utility for running operational tasks on Rancher clusters. In this use case, it will help you remove the Rancher from your installation nodes. #### Usage -After you move the `system-tools` file to your Rancher node, you can run it by changing to the file's directory and running the following command. +After you move the `system-tools` and kubeconfig file to your workstation's `/.kube/config` directory, you can run system-tools by changing to the `/.kube/config` directory and entering the following command. ->**Warning:** This command 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. +>**Warning:** This command will remove data from your etcd nodes. Make sure you have created a [backup of etcd]({{< baseurl >}}/rancher/v2.x/en/backups/backups) before executing the command. ``` ./system-tools remove --kubeconfig <$KUBECONFIG> --namespace @@ -86,9 +91,7 @@ Rather than cleaning imported cluster nodes using the Rancher UI, you can run a 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. Open kubectl. - -1. Using kubectl, make the script executable by running the following command from the same directory as `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 @@ -132,6 +135,6 @@ When cleaning nodes provisioned using Rancher, the following components are dele [3]: {{< baseurl >}}/rancher/v2.x/en/cluster-provisioning/hosted-kubernetes-clusters/ [4]: {{< baseurl >}}/rancher/v2.x/en/cluster-provisioning/imported-clusters/ ->**Using 2.0.7 or Earlier?** +>**Using 2.0.8 or Earlier?** > ->These versions of Rancher do not automatically delete the `serviceAccount`, `clusterRole`, and `clusterRole` resources after the job runs. You'll have to delete them yourself. \ No newline at end of file +>These versions of Rancher do not automatically delete the `serviceAccount`, `clusterRole`, and `clusterRoleBindings` resources after the job runs. You'll have to delete them yourself. \ No newline at end of file diff --git a/content/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster-nodes/_index.md b/content/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster-nodes/_index.md index f4e67b1346d..8ac921c100c 100644 --- a/content/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster-nodes/_index.md +++ b/content/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster-nodes/_index.md @@ -10,6 +10,25 @@ When you use Rancher to [provision nodes for a cluster]({{< baseurl >}}rancher/v When removing nodes from your Rancher-provisioned cluster (provided that they are in `Active` state), those resources automatically cleaned, and the only action needed is to restart the node. When a node has become unreachable and the automatic cleanup process cannot be used, we describe the steps that need to be executed before the node can be added to a cluster again. +## What Gets Removed? + +When cleaning nodes provisioned using Rancher, the following components are deleted based on the type of cluster node you're removing. + +| 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/ + ## Removing A Node from a Cluster by Rancher UI When the node is in `Active` state, removing the node from a cluster will trigger a process to clean up the node. Please restart the node after the automatic cleanup process is done to make sure any non-persistent data is properly removed. @@ -30,6 +49,60 @@ When a node is unreachable and removed from the cluster, the automatic cleaning >**Warning:** The commands listed below will remove data from the node. Make sure you have created a backup of files you want to keep before executing any of the commands as data will be lost. +## 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 %}} + + ### Docker Containers, Images, and Volumes Based on what role you assigned to the node, Kubernetes components in containers, containers belonging to overlay networking, DNS, ingress controller and Rancher agent. (and pods you created that have been scheduled to this node) From 91cfcf44f76e4ea35ed75563f2927dbeb758a1f0 Mon Sep 17 00:00:00 2001 From: Mark Bishop Date: Tue, 2 Oct 2018 14:17:48 -0700 Subject: [PATCH 09/12] fixed kubeconfig path --- .../removing-rancher/rancher-cluster-nodes/_index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 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 f475ff885be..a2526baa092 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 @@ -35,7 +35,7 @@ After you download the tools, complete the following actions: For instructions on how to download the Kubeconfig file, see [Accessing Clusters with kubectl and a kubeconfig File]({{< baseurl >}}rancher/v2.x/en/k8s-in-rancher/kubectl/#accessing-clusters-with-kubectl-and-a-kubeconfig-file). -1. Move `system-tools` to the same directory as the kubeconfig file: `/.kube/config`. +1. Move `system-tools` to the same directory as the kubeconfig file: `~/.kube/config`. ### Using the System-Tool @@ -43,7 +43,7 @@ System-tools is a utility for running operational tasks on Rancher clusters. In #### Usage -After you move the `system-tools` and kubeconfig file to your workstation's `/.kube/config` directory, you can run system-tools by changing to the `/.kube/config` directory and entering the following command. +After you move the `system-tools` and kubeconfig file to your workstation's `~/.kube/config` directory, you can run system-tools by changing to the `~/.kube/config` directory and entering the following command. >**Warning:** This command will remove data from your etcd nodes. Make sure you have created a [backup of etcd]({{< baseurl >}}/rancher/v2.x/en/backups/backups) before executing the command. From 0f604610089021d9c642b70d174691382937d2f5 Mon Sep 17 00:00:00 2001 From: Mark Bishop Date: Tue, 2 Oct 2018 14:26:49 -0700 Subject: [PATCH 10/12] 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?** > From 9372ba463b9f6c207e1ff3e42472e527d11a68ff Mon Sep 17 00:00:00 2001 From: Mark Bishop Date: Thu, 4 Oct 2018 17:17:41 -0700 Subject: [PATCH 11/12] making updates per Mohamed --- .../rancher-cluster-nodes/_index.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 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 d20733e6422..e0ca4e8d802 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 @@ -26,19 +26,18 @@ After you download the tools, complete the following actions: ``` chmod +x system-tools ``` -1. Download the Kubeconfig File for your Rancher installation cluster and place it in the `/.kube/config` on your workstation. System-tools uses this file to access your installation cluster. +1. Find the kubeconfig file that was generated during your Rancher installation, `kube_config_rancher-cluster.yml`. Move it to the `/.kube` on your workstation, if it isn't already there. Create this directory if it doesn't exist. + + System-tools uses this file to access your installation cluster. - For instructions on how to download the Kubeconfig file, see [Accessing Clusters with kubectl and a kubeconfig File]({{< baseurl >}}rancher/v2.x/en/k8s-in-rancher/kubectl/#accessing-clusters-with-kubectl-and-a-kubeconfig-file). -1. Move `system-tools` to the same directory as the kubeconfig file: `~/.kube/config`. - ### Using the System-Tool System-tools is a utility for running operational tasks on Rancher clusters. In this use case, it will help you remove the Rancher from your installation nodes. #### Usage -After you move the `system-tools` and kubeconfig file to your workstation's `~/.kube/config` directory, you can run system-tools by changing to the `~/.kube/config` directory and entering the following command. +After you move the `system-tools` and kubeconfig file to your workstation's `~/.kube` directory, you can run system-tools by changing to the `~/.kube` directory and entering the following command. >**Warning:** This command will remove data from your etcd nodes. Make sure you have created a [backup of etcd]({{< baseurl >}}/rancher/v2.x/en/backups/backups) before executing the command. @@ -54,10 +53,14 @@ When you run this command, the components listed in [What Gets Removed?](#what-g | Option | Description | | ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | -| `--kubeconfig <$KUBECONFIG>, -c <$KUBECONFIG>` | The cluster's kubeconfig file absolute path (`<$KUBECONFIG>`). | +| `--kubeconfig , -c ` | The cluster's kubeconfig file absolute path, usually `~/.kube/kube_config_rancher-cluster.yml`.1 | | `--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. | +> 1 If you are working with multiple Kubernetes clusters, you can place `kube_config_rancher-cluster.yml` in another directory path and then set the `KUBECONFIG` environment variable to its path. +>``` +export KUBECONFIG=$(pwd)/kube_config_rancher-cluster.yml +``` ## What Gets Removed? @@ -65,7 +68,7 @@ When removing Rancher from server nodes provisioned using RKE, the following com - The Rancher deployment namespace (`cattle-system` by default). -- `serviceAccount`, `clusterRoles`, and `clusterRoleBindings` labeled by Rancher. +- Any `serviceAccount`, `clusterRoles`, and `clusterRoleBindings` that Rancher applied the `cattle.io/creator:norman` label to. Rancher applies this label to any resource that it creates as of v2.1.0. - Labels, Annotations, and Finalizers. - Rancher Deployment. - Machines, clusters, projects, and user custom resource deployments (CRDs). From d87952e71cdd7f68350ee72b545432989bf5a26e Mon Sep 17 00:00:00 2001 From: Mark Bishop Date: Fri, 5 Oct 2018 15:13:18 -0700 Subject: [PATCH 12/12] fixing force push --- .../v2.x/en/admin-settings/removing-rancher/_index.md | 6 +++--- .../removing-rancher/rancher-cluster-nodes/_index.md | 6 +++--- .../removing-rancher/user-cluster-nodes/_index.md | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/content/rancher/v2.x/en/admin-settings/removing-rancher/_index.md b/content/rancher/v2.x/en/admin-settings/removing-rancher/_index.md index 535919c18c5..22e572b83e0 100644 --- a/content/rancher/v2.x/en/admin-settings/removing-rancher/_index.md +++ b/content/rancher/v2.x/en/admin-settings/removing-rancher/_index.md @@ -7,10 +7,10 @@ When you deploy Rancher and use it to provision clusters, Rancher installs its c There are two contexts in which you'd remove Rancher from a Kubernetes cluster node. -- [Removing Rancher from Rancher-Provisioned Nodes]({{< baseurl >}}/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster-nodes/) +- [Removing Rancher Components from Rancher Launched Kubernetes Clusters]({{< baseurl >}}/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster-nodes/) - In this context, you are removing Rancher from Kubernetes clusters that you provisioned using Rancher. + In this context, you are removing Rancher components from Kubernetes clusters that you [launched using Rancher]({{< baseurl >}}/rancher/v2.x/en/cluster-provisioning/rke-clusters/). - [Removing Rancher from Your Rancher Server Nodes]({{< baseurl >}}/rancher/v2.x/en/admin-settings/removing-rancher/rancher-cluster-nodes/) - In this context, you are removing Rancher from the Kubernetes cluster that your configured for your Rancher installation. + In this context, you are removing Rancher from the Kubernetes cluster that you configured for your [Rancher installation]({{< baseurl >}}/rancher/v2.x/en/installation/ha/). 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 e0ca4e8d802..bda2d63808d 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 @@ -1,5 +1,5 @@ --- -title: Removing Rancher from Rancher Server Nodes +title: Removing Rancher from Your Rancher Server Nodes weight: 2000 --- @@ -64,12 +64,12 @@ export KUBECONFIG=$(pwd)/kube_config_rancher-cluster.yml ## What Gets Removed? -When removing Rancher from server nodes provisioned using RKE, the following components are deleted. +When removing Rancher from server nodes launched using RKE, the following components are deleted. - The Rancher deployment namespace (`cattle-system` by default). - Any `serviceAccount`, `clusterRoles`, and `clusterRoleBindings` that Rancher applied the `cattle.io/creator:norman` label to. Rancher applies this label to any resource that it creates as of v2.1.0. -- Labels, Annotations, and Finalizers. +- 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. diff --git a/content/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster-nodes/_index.md b/content/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster-nodes/_index.md index 8ac921c100c..5431793e941 100644 --- a/content/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster-nodes/_index.md +++ b/content/rancher/v2.x/en/admin-settings/removing-rancher/user-cluster-nodes/_index.md @@ -1,14 +1,14 @@ --- -title: Removing Rancher from Rancher-Provisioned Nodes +title: Removing Rancher Components from Rancher Launched Kubernetes Nodes weight: 375 aliases: - /rancher/v2.x/en/installation/removing-rancher/cleaning-cluster-nodes/ - /rancher/v2.x/en/installation/removing-rancher/ - /rancher/v2.x/en/faq/cleaning-cluster-nodes/ --- -When you use Rancher to [provision nodes for a cluster]({{< baseurl >}}rancher/v2.x/en/cluster-provisioning/#cluster-creation-in-rancher), resources (containers/virtual network interfaces) and configuration items (certificates/configuration files) are created. +When you use Rancher to [launch nodes for a cluster]({{< baseurl >}}rancher/v2.x/en/cluster-provisioning/#cluster-creation-in-rancher), resources (containers/virtual network interfaces) and configuration items (certificates/configuration files) are created. -When removing nodes from your Rancher-provisioned cluster (provided that they are in `Active` state), those resources automatically cleaned, and the only action needed is to restart the node. When a node has become unreachable and the automatic cleanup process cannot be used, we describe the steps that need to be executed before the node can be added to a cluster again. +When removing nodes from your Rancher-launched cluster (provided that they are in `Active` state), those resources automatically cleaned, and the only action needed is to restart the node. When a node has become unreachable and the automatic cleanup process cannot be used, we describe the steps that need to be executed before the node can be added to a cluster again. ## What Gets Removed?