Uninstall Kubernetes and KubeSphere
This section explains how to uninstall Kubernetes and KubeSphere.
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 Kubernetes and KubeSphere.
Note If you are unable to get the installation configuration file config-sample.yaml, you need to refer to Install Kubernetes and KubeSphere 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
-
If you are accessing GitHub/Googleapis from a restricted location, please log in to any cluster node and run the following command to set the download region:
export KKZONE=cn
-
Run the following command to download the latest version of KubeKey:
curl -sfL https://get-kk.kubesphere.io | sh -
After the download is complete, a KubeKey binary file kk will be generated in the current directory.
Note If the cluster node used to perform the operations cannot connect to the internet, you can manually download KubeKey on a device with internet access and then transfer it to the cluster node.
-
Add execute permission to the KubeKey binary file kk:
sudo chmod +x kk
-
Transfer the installation configuration file config-sample.yaml to the current directory.
-
Run the following command to uninstall KubeSphere.
./kk delete cluster -f config-sample.yaml
If you see the following message, it means the uninstallation is successful:
Pipeline[DeleteClusterPipeline] execute successful
Feedback
Was this page Helpful?
Receive the latest news, articles and updates from KubeSphere
Thanks for the feedback. If you have a specific question about how to use KubeSphere, ask it on Slack. Open an issue in the GitHub repo if you want to report a problem or suggest an improvement.