Merge pull request #1602 from sunilarjun/update-directories

Removing Incorrect Directories - [SURE-8597]
This commit is contained in:
Sunil Singh
2025-05-27 13:25:24 -07:00
committed by GitHub
14 changed files with 1645 additions and 245 deletions
@@ -242,12 +242,62 @@ sudo k3s-uninstall.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`.
:::note
:::important
Depending on the role you assigned to the node, some of the directories will or won't be present on the node.
Depending on the role you assigned to the node, certain directories may or may not be present on the node.
:::
<Tabs>
<TabItem value="RKE1">
| 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
```
</TabItem>
<TabItem value="RKE2">
| Directories |
|------------------------------|
| `/etc/ceph` |
@@ -255,43 +305,93 @@ Depending on the role you assigned to the node, some of the directories will or
| `/etc/kubernetes` |
| `/etc/rancher` |
| `/opt/cni` |
| `/opt/rke` |
| `/run/secrets/kubernetes.io` |
| `/run/calico` |
| `/run/flannel` |
| `/run/secrets/kubernetes.io` |
| `/var/lib/calico` |
| `/var/lib/etcd` |
| `/var/lib/cni` |
| `/var/lib/etcd` |
| `/var/lib/kubelet` |
| `/var/lib/rancher` |
| `/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 \
/etc/rancher \
/opt/cni \
/opt/rke \
/run/secrets/kubernetes.io \
/run/calico \
/run/flannel \
/run/secrets/kubernetes.io \
/var/lib/calico \
/var/lib/etcd \
/var/lib/cni \
/var/lib/etcd \
/var/lib/kubelet \
/var/lib/rancher\
/var/lib/rancher \
/var/lib/weave \
/var/log/containers \
/var/log/kube-audit \
/var/log/pods \
/var/run/calico
```
</TabItem>
<TabItem value="K3s">
| Directories |
|------------------------------|
| `/etc/ceph` |
| `/etc/cni` |
| `/etc/kubernetes` |
| `/etc/rancher` |
| `/etc/systemd/system/k3s` |
| `/opt/cni` |
| `/run/calico` |
| `/run/flannel` |
| `/run/secrets/kubernetes.io` |
| `/usr/local/bin/k3s` |
| `/var/lib/calico` |
| `/var/lib/cni` |
| `/var/lib/etcd` |
| `/var/lib/kubelet` |
| `/var/lib/rancher` |
| `/var/lib/weave` |
| `/var/log/containers` |
| `/var/log/pods` |
| `/var/run/calico` |
**To clean the directories:**
```shell
rm -rf /etc/ceph \
/etc/cni \
/etc/kubernetes \
/etc/rancher \
/etc/systemd/system/k3s \
/opt/cni \
/run/calico \
/run/flannel \
/run/secrets/kubernetes.io \
/usr/local/bin/k3s \
/var/lib/calico \
/var/lib/cni \
/var/lib/etcd \
/var/lib/kubelet \
/var/lib/rancher \
/var/lib/weave \
/var/log/containers \
/var/log/pods \
/var/run/calico
```
</TabItem>
</Tabs>
### 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. To remove these components, a restart is recommended.