diff --git a/docs/how-to-guides/new-user-guides/manage-clusters/clean-cluster-nodes.md b/docs/how-to-guides/new-user-guides/manage-clusters/clean-cluster-nodes.md index 2ed1d943849..0bd0562745e 100644 --- a/docs/how-to-guides/new-user-guides/manage-clusters/clean-cluster-nodes.md +++ b/docs/how-to-guides/new-user-guides/manage-clusters/clean-cluster-nodes.md @@ -123,65 +123,6 @@ Install [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/). ## Cleaning up Nodes - - -Before you run the following commands, first remove the node through the Rancher UI. - -To remove a node: - -1. Click **☰** and select **Cluster Management**. -1. In the table of clusters, click the name of the cluster the node belongs to. -1. In the first tab, click the checkbox next to the node's state. -1. Click **Delete**. - -If you remove the entire cluster instead of an individual node, or skip rermoving the node through the Rancher UI, follow these steps: - -1. [Remove](#docker-containers-images-and-volumes) the Docker containers from the node and [unmount](#mounts) any volumes. -1. Reboot the node. -1. [Remove](#directories-and-files) any remaining files. -1. Confirm that network interfaces and IP tables were properly cleaned after the reboot. If not, reboot one more time. - -### Windows Nodes - -To clean up a Windows node, run the script in `c:\etc\rancher`. This script deletes Kubernetes-generated resources and the execution binary. It also drops the firewall rules and network settings: - -``` -pushd c:\etc\rancher -.\cleanup.ps1 -popd -``` - -After you run this script, the node is reset and can be re-added to a Kubernetes cluster. - -### Docker Containers, Images, and Volumes - -:::caution - -Be careful when cleaning up Docker containers. The following command will remove *all* Docker containers, images, and volumes on the node, including non-Rancher related containers: - -::: - -``` -docker rm -f $(docker ps -qa) -docker rmi -f $(docker images -q) -docker volume rm $(docker volume ls -q) -``` - -### Mounts - -Kubernetes components and secrets leave behind the following mounts: - -* `/var/lib/kubelet` -* `/var/lib/rancher` -* Miscellaneous mounts in `/var/lib/kubelet/pods/` - -To unmount all mounts, run: - -``` -for mount in $(mount | grep tmpfs | grep '/var/lib/kubelet' | awk '{ print $3 }') /var/lib/kubelet /var/lib/rancher; do umount $mount; done -``` - - :::note @@ -248,54 +189,7 @@ Depending on the role you assigned to the node, certain directories may or may n ::: - - - -| Directories | -|------------------------------| -| `/etc/ceph` | -| `/etc/cni` | -| `/etc/kubernetes` | -| `/opt/cni` | -| `/opt/rke` | -| `/run/calico` | -| `/run/flannel` | -| `/run/secrets/kubernetes.io` | -| `/var/lib/calico` | -| `/var/lib/cni` | -| `/var/lib/etcd` | -| `/var/lib/kubelet` | -| `/var/lib/rancher/rke` | -| `/var/lib/weave` | -| `/var/log/containers` | -| `/var/log/kube-audit` | -| `/var/log/pods` | -| `/var/run/calico` | - -**To clean the directories:** - -```shell -rm -rf /etc/ceph \ - /etc/cni \ - /etc/kubernetes \ - /opt/cni \ - /opt/rke \ - /run/calico \ - /run/flannel \ - /run/secrets/kubernetes.io \ - /var/lib/calico \ - /var/lib/cni \ - /var/lib/etcd \ - /var/lib/kubelet \ - /var/lib/rancher/rke \ - /var/lib/weave \ - /var/log/containers \ - /var/log/kube-audit \ - /var/log/pods \ - /var/run/calico -``` - - + | Directories | diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/how-to-guides/new-user-guides/manage-clusters/clean-cluster-nodes.md b/i18n/zh/docusaurus-plugin-content-docs/current/how-to-guides/new-user-guides/manage-clusters/clean-cluster-nodes.md index 369a7be6f29..a2d3d658629 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/how-to-guides/new-user-guides/manage-clusters/clean-cluster-nodes.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/how-to-guides/new-user-guides/manage-clusters/clean-cluster-nodes.md @@ -118,66 +118,7 @@ $ sudo shutdown -r now ## 清理节点 - - - -在运行以下命令之前,首先通过 Rancher UI 删除节点。 - -要删除节点: - -1. 点击 **☰** 并选择**集群管理**。 -1. 在集群表中,单击节点所属集群的名称。 -1. 在第一个选项卡中,单击节点状态旁边的复选框。 -1. 单击**删除**。 - -要删除整个集群而不是单个节点,或者不使用 Rancher UI 重新移动节点,请按照以下步骤操作: - -1. 从节点中[删除](#docker-容器镜像和卷) Docker 容器并[卸载](#挂载)任何卷。 -1. 重启节点。 -1. [删除](#目录和文件)所有剩余的文件。 -1. 确认在重新启动后已正确清理网络接口和 IP 表。否则请再重启一次。 - -### Windows 节点 - -要清理 Windows 节点,请运行 `c:\\etc\\rancher` 中的脚本。此脚本删除 Kubernetes 生成的资源和执行二进制文件,还会删除防火墙规则和网络设置: - -``` -pushd c:\etc\rancher -.\cleanup.ps1 -popd -``` - -运行此脚本后,节点将重置并可以重新添加到 Kubernetes 集群。 - -### Docker 容器、镜像和卷 - -:::caution - -清理 Docker 容器时要小心。以下命令将删除节点上的*所有* Docker 容器、镜像和卷,包括与 Rancher 无关的容器: - -::: - -``` -docker rm -f $(docker ps -qa) -docker rmi -f $(docker images -q) -docker volume rm $(docker volume ls -q) -``` - -### 挂载 - -Kubernetes 组件和 secret 会留下以下挂载: - -* `/var/lib/kubelet` -* `/var/lib/rancher` -* `/var/lib/kubelet/pods/` 中的其他挂载 - -要卸载所有挂载,请运行: - -``` -for mount in $(mount | grep tmpfs | grep '/var/lib/kubelet' | awk '{ print $3 }') /var/lib/kubelet /var/lib/rancher; do umount $mount; done -``` - - + :::note @@ -245,53 +186,6 @@ sudo k3s-uninstall.sh ::: - - -| 目录 | -|------------------------------| -| `/etc/ceph` | -| `/etc/cni` | -| `/etc/kubernetes` | -| `/opt/cni` | -| `/opt/rke` | -| `/run/calico` | -| `/run/flannel` | -| `/run/secrets/kubernetes.io` | -| `/var/lib/calico` | -| `/var/lib/cni` | -| `/var/lib/etcd` | -| `/var/lib/kubelet` | -| `/var/lib/rancher/rke` | -| `/var/lib/weave` | -| `/var/log/containers` | -| `/var/log/kube-audit` | -| `/var/log/pods` | -| `/var/run/calico` | - -**清理目录**: - -```shell -rm -rf /etc/ceph \ - /etc/cni \ - /etc/kubernetes \ - /opt/cni \ - /opt/rke \ - /run/calico \ - /run/flannel \ - /run/secrets/kubernetes.io \ - /var/lib/calico \ - /var/lib/cni \ - /var/lib/etcd \ - /var/lib/kubelet \ - /var/lib/rancher/rke \ - /var/lib/weave \ - /var/log/containers \ - /var/log/kube-audit \ - /var/log/pods \ - /var/run/calico -``` - - | 目录 | diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-2.12/how-to-guides/new-user-guides/manage-clusters/clean-cluster-nodes.md b/i18n/zh/docusaurus-plugin-content-docs/version-2.12/how-to-guides/new-user-guides/manage-clusters/clean-cluster-nodes.md index 369a7be6f29..a2d3d658629 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/version-2.12/how-to-guides/new-user-guides/manage-clusters/clean-cluster-nodes.md +++ b/i18n/zh/docusaurus-plugin-content-docs/version-2.12/how-to-guides/new-user-guides/manage-clusters/clean-cluster-nodes.md @@ -118,66 +118,7 @@ $ sudo shutdown -r now ## 清理节点 - - - -在运行以下命令之前,首先通过 Rancher UI 删除节点。 - -要删除节点: - -1. 点击 **☰** 并选择**集群管理**。 -1. 在集群表中,单击节点所属集群的名称。 -1. 在第一个选项卡中,单击节点状态旁边的复选框。 -1. 单击**删除**。 - -要删除整个集群而不是单个节点,或者不使用 Rancher UI 重新移动节点,请按照以下步骤操作: - -1. 从节点中[删除](#docker-容器镜像和卷) Docker 容器并[卸载](#挂载)任何卷。 -1. 重启节点。 -1. [删除](#目录和文件)所有剩余的文件。 -1. 确认在重新启动后已正确清理网络接口和 IP 表。否则请再重启一次。 - -### Windows 节点 - -要清理 Windows 节点,请运行 `c:\\etc\\rancher` 中的脚本。此脚本删除 Kubernetes 生成的资源和执行二进制文件,还会删除防火墙规则和网络设置: - -``` -pushd c:\etc\rancher -.\cleanup.ps1 -popd -``` - -运行此脚本后,节点将重置并可以重新添加到 Kubernetes 集群。 - -### Docker 容器、镜像和卷 - -:::caution - -清理 Docker 容器时要小心。以下命令将删除节点上的*所有* Docker 容器、镜像和卷,包括与 Rancher 无关的容器: - -::: - -``` -docker rm -f $(docker ps -qa) -docker rmi -f $(docker images -q) -docker volume rm $(docker volume ls -q) -``` - -### 挂载 - -Kubernetes 组件和 secret 会留下以下挂载: - -* `/var/lib/kubelet` -* `/var/lib/rancher` -* `/var/lib/kubelet/pods/` 中的其他挂载 - -要卸载所有挂载,请运行: - -``` -for mount in $(mount | grep tmpfs | grep '/var/lib/kubelet' | awk '{ print $3 }') /var/lib/kubelet /var/lib/rancher; do umount $mount; done -``` - - + :::note @@ -245,53 +186,6 @@ sudo k3s-uninstall.sh ::: - - -| 目录 | -|------------------------------| -| `/etc/ceph` | -| `/etc/cni` | -| `/etc/kubernetes` | -| `/opt/cni` | -| `/opt/rke` | -| `/run/calico` | -| `/run/flannel` | -| `/run/secrets/kubernetes.io` | -| `/var/lib/calico` | -| `/var/lib/cni` | -| `/var/lib/etcd` | -| `/var/lib/kubelet` | -| `/var/lib/rancher/rke` | -| `/var/lib/weave` | -| `/var/log/containers` | -| `/var/log/kube-audit` | -| `/var/log/pods` | -| `/var/run/calico` | - -**清理目录**: - -```shell -rm -rf /etc/ceph \ - /etc/cni \ - /etc/kubernetes \ - /opt/cni \ - /opt/rke \ - /run/calico \ - /run/flannel \ - /run/secrets/kubernetes.io \ - /var/lib/calico \ - /var/lib/cni \ - /var/lib/etcd \ - /var/lib/kubelet \ - /var/lib/rancher/rke \ - /var/lib/weave \ - /var/log/containers \ - /var/log/kube-audit \ - /var/log/pods \ - /var/run/calico -``` - - | 目录 | diff --git a/versioned_docs/version-2.12/how-to-guides/new-user-guides/manage-clusters/clean-cluster-nodes.md b/versioned_docs/version-2.12/how-to-guides/new-user-guides/manage-clusters/clean-cluster-nodes.md index 2ed1d943849..0bd0562745e 100644 --- a/versioned_docs/version-2.12/how-to-guides/new-user-guides/manage-clusters/clean-cluster-nodes.md +++ b/versioned_docs/version-2.12/how-to-guides/new-user-guides/manage-clusters/clean-cluster-nodes.md @@ -123,65 +123,6 @@ Install [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/). ## Cleaning up Nodes - - -Before you run the following commands, first remove the node through the Rancher UI. - -To remove a node: - -1. Click **☰** and select **Cluster Management**. -1. In the table of clusters, click the name of the cluster the node belongs to. -1. In the first tab, click the checkbox next to the node's state. -1. Click **Delete**. - -If you remove the entire cluster instead of an individual node, or skip rermoving the node through the Rancher UI, follow these steps: - -1. [Remove](#docker-containers-images-and-volumes) the Docker containers from the node and [unmount](#mounts) any volumes. -1. Reboot the node. -1. [Remove](#directories-and-files) any remaining files. -1. Confirm that network interfaces and IP tables were properly cleaned after the reboot. If not, reboot one more time. - -### Windows Nodes - -To clean up a Windows node, run the script in `c:\etc\rancher`. This script deletes Kubernetes-generated resources and the execution binary. It also drops the firewall rules and network settings: - -``` -pushd c:\etc\rancher -.\cleanup.ps1 -popd -``` - -After you run this script, the node is reset and can be re-added to a Kubernetes cluster. - -### Docker Containers, Images, and Volumes - -:::caution - -Be careful when cleaning up Docker containers. The following command will remove *all* Docker containers, images, and volumes on the node, including non-Rancher related containers: - -::: - -``` -docker rm -f $(docker ps -qa) -docker rmi -f $(docker images -q) -docker volume rm $(docker volume ls -q) -``` - -### Mounts - -Kubernetes components and secrets leave behind the following mounts: - -* `/var/lib/kubelet` -* `/var/lib/rancher` -* Miscellaneous mounts in `/var/lib/kubelet/pods/` - -To unmount all mounts, run: - -``` -for mount in $(mount | grep tmpfs | grep '/var/lib/kubelet' | awk '{ print $3 }') /var/lib/kubelet /var/lib/rancher; do umount $mount; done -``` - - :::note @@ -248,54 +189,7 @@ Depending on the role you assigned to the node, certain directories may or may n ::: - - - -| Directories | -|------------------------------| -| `/etc/ceph` | -| `/etc/cni` | -| `/etc/kubernetes` | -| `/opt/cni` | -| `/opt/rke` | -| `/run/calico` | -| `/run/flannel` | -| `/run/secrets/kubernetes.io` | -| `/var/lib/calico` | -| `/var/lib/cni` | -| `/var/lib/etcd` | -| `/var/lib/kubelet` | -| `/var/lib/rancher/rke` | -| `/var/lib/weave` | -| `/var/log/containers` | -| `/var/log/kube-audit` | -| `/var/log/pods` | -| `/var/run/calico` | - -**To clean the directories:** - -```shell -rm -rf /etc/ceph \ - /etc/cni \ - /etc/kubernetes \ - /opt/cni \ - /opt/rke \ - /run/calico \ - /run/flannel \ - /run/secrets/kubernetes.io \ - /var/lib/calico \ - /var/lib/cni \ - /var/lib/etcd \ - /var/lib/kubelet \ - /var/lib/rancher/rke \ - /var/lib/weave \ - /var/log/containers \ - /var/log/kube-audit \ - /var/log/pods \ - /var/run/calico -``` - - + | Directories |