Skip to content

Instantly share code, notes, and snippets.

@jvyden
Created March 4, 2023 03:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jvyden/dd0d158b92f0f562f0cdd7a82ec16d73 to your computer and use it in GitHub Desktop.
Save jvyden/dd0d158b92f0f562f0cdd7a82ec16d73 to your computer and use it in GitHub Desktop.
Kubelet systemd daemon override file for automatically draining node on shutdown
[Service]
ExecStartPost=/usr/bin/kubectl uncordon %H --kubeconfig /root/.kube/config
ExecStop=/usr/bin/kubectl drain %H --ignore-daemonsets --delete-emptydir-data --force --grace-period=30 --kubeconfig /root/.kube/config
TimeoutStopSec=120
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment