Skip to content

Instantly share code, notes, and snippets.

@guilhem
Last active April 2, 2021 12:04
Show Gist options
  • Save guilhem/39ddaec568969993e330e9e87f239a01 to your computer and use it in GitHub Desktop.
Save guilhem/39ddaec568969993e330e9e87f239a01 to your computer and use it in GitHub Desktop.
[Unit]
Description=Cleanup pod directory on reboot
Before=kubelet.service
Before=docker.service # for rke install
[Service]
Type=oneshot
Environment=KUBELET_DIR='/var/lib/kubelet/'
ExecStart=/usr/bin/find ${KUBELET_DIR} -mindepth 1 -delete
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment