WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

snapp-incubator/safe-drain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Safe Drain

safe-drain is a simple tool that helps safely evict pods from a Kubernetes node by ensuring they are properly recreated before moving on. It is designed as a safer alternative to kubectl drain, focusing on controller-managed pods to minimize disruption.

Features

  • Evicts controller-managed pods (Deployments, StatefulSets, DaemonSets, etc.) one by one.
  • Waits for each evicted pod to be recreated and ready before continuing.
  • Helps perform safe node draining during maintenance or scaling operations.
  • Simple CLI with minimal configuration.

Installation

Clone the repository and build from source:

git clone https://github.com/<your-username>/safe-drain.git
cd safe-drain
go build -o safe-drain

Or download a pre-built binary from Releases.

Usage

safe-drain -kubeconfig ~/.kube/config -node <node-name>

Options

-kubeconfig string
    absolute path to the kubeconfig file
-node string
    The name of the node to drain and verify.
-timeout duration
    Timeout for waiting for all pods to be replaced. (default 10m0s)

Example

Drain a node named worker-1 using a custom kubeconfig:

safe-drain -kubeconfig ~/.kube/my-cluster.yaml -node worker-1

Release Process

  1. Create a new tag on the main branch
  2. Create a new release on GitHub with the tag
  3. GitHub Actions will automatically build and publish the binaries

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests to improve functionality.

About

A tool to ensure "all your pods are up and running after we drain a node"

Resources

License

Stars

Watchers

Forks

Packages

No packages published