NodeReaper acts as a cost-saving failsafe that detects and removes nodes running only system pods, helping reduce cloud costs when autoscalers miss cleanup opportunities. Like the Grim Reaper, it comes for nodes whose time has come - but only the ones that truly deserve it.
Sometimes autoscalers (Cluster Autoscaler, Karpenter, etc.) fail to scale down expensive nodes, leaving them running with only system pods. NodeReaper acts as a reliable failsafe that detects and removes these "zombie" nodes.
- Scans nodes every 10 minutes (configurable)
- Skips protected nodes with protection annotations or labels
- Waits for minimum age before considering nodes for deletion
- Identifies empty nodes that only run DaemonSet pods
- Uses Prometheus metrics (optional) to track how long nodes have been empty
- Removes unhealthy nodes that are unreachable or not ready
- Cleans stuck finalizers from nodes that won't terminate
- Sends notifications when nodes are deleted
# Install with Helm
helm install nodereaper oci://ghcr.io/sdaberdaku/charts/nodereaper \
--namespace nodereaper \
--create-namespaceEnable Prometheus integration to track node empty duration more accurately:
# values.yaml - With authentication
prometheus:
enabled: true
url: "http://prometheus-server:9090"
minEmptyDuration: "10m" # Only delete nodes empty for 10+ minutes
authentication:
enabled: true
existingSecret:
name: "prometheus-credentials"
usernameKey: "username"
passwordKey: "password"# values.yaml - Without authentication (for internal/development use)
prometheus:
enabled: true
url: "http://prometheus-server:9090"
minEmptyDuration: "10m"
auth:
enabled: false # No authentication requiredWhen enabled, NodeReaper queries Prometheus to determine how long nodes have been empty, providing more precise deletion timing than age-based logic alone.
- Dry-run mode - Test without actually deleting nodes
- Age protection - Never deletes newly created nodes
- Annotation protection - Respects "do not delete" markers
- Label protection - Skips nodes with protection labels
- Finalizer whitelist - Only removes known-safe finalizers
# Setup
git clone https://github.com/sdaberdaku/nodereaper.git
cd nodereaper
make install-dev
# Testing
make test # Unit tests
make test-integration # Integration tests with kind
make test-all # All tests
make checks # Quality checks
# Local testing
make setup-cluster # Set up kind cluster
DRY_RUN=true LOG_LEVEL=DEBUG nodereaperApache License 2.0 - see LICENSE for details.
