Monitors AWS EC2 instances and automatically terminates those exceeding configured runtime thresholds.
helm repo add aws-ec2-runtime-checker https://rayselfs.github.io/aws-ec2-runtime-checker
helm install aws-ec2-runtime-checker aws-ec2-runtime-checker/aws-ec2-runtime-checker
For detailed Helm configuration options, IAM policies, and deployment modes, see the Helm Chart README.
git clone https://github.com/rayselfs/aws-ec2-runtime-checker
cd aws-ec2-runtime-checker
helm install aws-ec2-runtime-checker ./charts/aws-ec2-runtime-checker
Create a values.yaml file:
aws:
region: "us-east-1"
dryRun: true # Set to false to enable actual termination
targets:
- instanceType: "t2.micro"
maxRuntimeHours: 24
- instanceType: "t3.micro"
maxRuntimeHours: 48
Install with custom values:
helm install aws-ec2-runtime-checker aws-ec2-runtime-checker/aws-ec2-runtime-checker -f values.yaml
For complete configuration options and production setup, refer to the Helm Chart README.
The config.json file (mounted via ConfigMap) should contain:
[
{
"instanceType": "t2.micro",
"maxRuntimeHours": 24
},
{
"instanceType": "t3.micro",
"maxRuntimeHours": 48
}
]
kind: Deployment
replicaCount: 2
schedule: "*/5 * * * *" # Every 5 minutes
leaderElection:
enabled: true # Required when replicaCount > 1
kind: CronJob
schedule: "0 */6 * * *" # Every 6 hours
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
Content type
Image
Digest
sha256:562e5b2f8…
Size
20.2 MB
Last updated
12 months ago
docker pull rayselfs/aws-ec2-runtime-checker