Skip to content

dkeightley/node-drain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

node-drain

A systemd service and script to drain and optionally delete nodes on shutdown/restart.

Install

Download the files

  • git clone this repo
  • cd node-drain

or

curl -OLs https://raw.githubusercontent.com/dkeightley/node-drain/master/node-drain.service
curl -OLs https://raw.githubusercontent.com/dkeightley/node-drain/master/node-drain.sh

Copy files into place and enable the service

cp node-drain.sh /usr/local/bin/
cp node-drain.service /etc/systemd/system/
systemctl enable node-drain
systemctl daemon-reload
systemctl start node-drain

Check the logs

journalctl -u node-drain

Usage

node-drain systemd service for RKE and k3s

  Usage: bash node-drain.sh [ -d -n -r <container runtime> ]

    All flags are optional:
    -d    Delete local data, pods using emptyDir volumes will be drained as well
    -n    Delete node as well, useful for immutable infrastructure as nodes are replaced on shutdown
    -r    Override container runtime if not automatically detected (docker|k3s)

About

Automated node draining for RKE/k3s

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages