Removing Rancher from Your Rancher Server Nodes
When you want to remove Rancher from your installation cluster 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
You can download the latest version of Rancher system-tools from its GitHub releases page. Download the version of system-tools for the OS that you’re running the tool from.
After you download the tools, complete the following actions:
Rename the file to
Give the file executable permissions by running the following command:
chmod +x system-tools
Find the kubeconfig file that was generated during your Rancher installation,
kube_config_rancher-cluster.yml. Move it to the
~/.kubeon 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.
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.
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 before executing the command.
./system-tools remove --kubeconfig <$KUBECONFIG> --namespace <NAMESPACE>
When you run this command, the components listed in What Gets Removed? are deleted.
||The cluster’s kubeconfig file absolute path, usually
||Rancher 2.x deployment namespace (
||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.ymlin another directory path and then set the
KUBECONFIGenvironment variable to its path.
What Gets Removed?
When removing Rancher from server nodes launched using RKE, the following components are deleted.
- The Rancher deployment namespace (
clusterRoleBindingsthat Rancher applied the
cattle.io/creator:normanlabel 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).
- All resources create under the
- All CRDs created by Rancher v2.0.x.
Using 2.0.8 or Earlier?
These versions of Rancher do not automatically delete the
clusterRoleBindingsresources after the job runs. You’ll have to delete them yourself.