Last active
November 19, 2024 23:24
-
-
Save cardyok/a99743545e68714c7b0b819ce18fc357 to your computer and use it in GitHub Desktop.
reflection node cleanup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| if stat /opt/dlami/nvme/lepton/containerd; then | |
| systemctl restart kubelet | |
| systemctl restart gpud | |
| exit 0 | |
| fi | |
| systemctl stop gpud | |
| systemctl stop kubelet | |
| crictl pods -q | xargs crictl -t 20s stopp | |
| crictl pods -q | xargs crictl -t 20s rmp | |
| crictl images | awk -F " " '{print $3}' |xargs crictl rmi | |
| systemctl stop containerd | |
| mkdir -p /opt/dlami/nvme/lepton/kubelet | |
| mkdir -p /opt/dlami/nvme/lepton/containerd | |
| mv /var/lib/kubelet/* /opt/dlami/nvme/lepton/kubelet/ | |
| rm -rf /var/lib/containerd | |
| rm -rf /var/lib/kubelet | |
| mkdir -p /var/lib/containerd | |
| mkdir -p /var/lib/kubelet | |
| mount --bind /opt/dlami/nvme/lepton/kubelet /var/lib/kubelet | |
| mount --bind /opt/dlami/nvme/lepton/containerd /var/lib/containerd | |
| systemctl restart containerd | |
| systemctl restart kubelet | |
| systemctl restart gpud |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment