https://github.com/uswitch/surtr
AWS Kubernetes Node Terminator
https://github.com/uswitch/surtr
aws kubernetes
Last synced: 11 months ago
JSON representation
AWS Kubernetes Node Terminator
- Host: GitHub
- URL: https://github.com/uswitch/surtr
- Owner: uswitch
- License: apache-2.0
- Created: 2018-08-31T14:37:05.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-07-05T08:20:22.000Z (almost 3 years ago)
- Last Synced: 2024-06-20T13:29:42.909Z (about 2 years ago)
- Topics: aws, kubernetes
- Language: Go
- Homepage:
- Size: 2.92 MB
- Stars: 22
- Watchers: 10
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Surtr
Surtr is a cron job that will terminate the oldest node in your kubernetes cluster.
Having really old nodes in your cluster isn't ideal, it can make you vulnerable to malicious attacks and can sometimes hide failure states in your applications.
By making sure no node ever lives too long you both remove the potential security risk and expose flaws in your cluster/application design, if taking out one node causes a load of errors you know you need to improve the resilience of your services.
# Usage
Surtr is intended to be ran as cron-job, see the [examples](examples) directory for the cron and rbac definitions.
Surtr needs to be able to query the Kubernetes api for a list of the nodes, it finds the oldest node, checks it's older than the min age specified and then sends an ec2 termination request for that node.
# AWS Permissions
Surtr just needs `ec2:TerminateInstances`
```
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Action": [
"ec2:TerminateInstances"
],
"Effect": "Allow",
"Resource": [
"*"
]
}
]
}
```
# Flags
```
--help Show context-sensitive help (also try --help-long and --help-man).
--kubeconfig=KUBECONFIG Path to kubeconfig.
--older-than=OLDER-THAN age of nodes to terminate
--debug Debug mode
```