Skip to content

Instantly share code, notes, and snippets.

@cardyok
Last active November 19, 2024 23:24
Show Gist options
  • Select an option

  • Save cardyok/a99743545e68714c7b0b819ce18fc357 to your computer and use it in GitHub Desktop.

Select an option

Save cardyok/a99743545e68714c7b0b819ce18fc357 to your computer and use it in GitHub Desktop.
reflection node cleanup
#!/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