Uninstall Kubernetes and KubeSphere Enterprise
This section explains how to uninstall Kubernetes and KubeSphere Enterprise.
Note |
---|
The uninstallation method for Kubernetes described in this section only applies to Kubernetes installed using KubeKey. If your Kubernetes is not installed through KubeKey, please refer to the Kubernetes Documentation for uninstallation instructions. |
Warning |
---|
The uninstallation will cause business interruption to the KubeSphere cluster and cannot be undone. Please proceed with caution. |
Prerequisites
-
You should get the installation configuration file config-sample.yaml and transfer it to the cluster nodes where you will perform the uninstallation. For more information, refer to Install KubeSphere Enterprise.
Warning If you are unable to get the installation configuration file config-sample.yaml, you need to refer to Install KubeSphere Enterprise to recreate the config-sample.yaml file. When recreating the file, make sure that the cluster information in the file matches the current state of the cluster. Otherwise, the uninstallation process may encounter errors.
-
To avoid data loss, please back up all important data in advance.
Steps
-
Transfer the KubeSphere Enterprise installation package to a cluster node and log in to the cluster node.
-
Execute the following command to decompress the installation package and enter the directory generated after decompression (replace <package name> with the actual name of the installation package, and replace <directory> with the directory generated after decompression):
tar -zxvf <package name>
cd <directory>
-
Execute the following command to add execution permissions to the KubeKey binary kk:
sudo chmod +x kk
-
Transfer the installation configuration file config-sample.yaml to the current directory.
-
Run the following command to uninstall KubeSphere Enterprise.
./kk delete cluster -f config-sample.yaml
If you see the following message, it means the uninstallation is successful:
Pipeline[DeleteClusterPipeline] execute successful