# aws/aws-node-termination-handler

Gracefully handle EC2 instance shutdown within Kubernetes

Repository: https://github.com/aws/aws-node-termination-handler
Canonical: https://ross.abutalabs.com/products/aws-node-termination-handler
Homepage: https://aws.amazon.com/ec2
Language: Go
License: Apache-2.0
License Family: permissive
Topics: kubernetes, aws-ec2, spot-instances, eks, golang, maintenance-events
Last push: 2026-07-21T22:42:37+00:00

## Health v2 (maintenance only)
Score: 85/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 93, release rhythm 65, longevity 100
- inputs: {"age_days": 2508, "days_push": 43, "days_rel": 153, "gap_med": 41, "n_releases_24m": 10}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1762, forks 286 (observed 2026-08-28T04:05:32.761241+00:00)

## What it is
AWS Node Termination Handler is a Kubernetes daemon/controller that watches for EC2 instance shutdown events such as Spot interruptions, maintenance events, and ASG scale-in. It cordons and drains affected nodes so workloads stop gracefully and are rescheduled elsewhere.

## Use cases
- gracefully drain kubernetes nodes before ec2 spot interruption
- handle aws maintenance events in eks cluster
- cordon and drain nodes on asg scale-in
- avoid scheduling pods on terminating ec2 instances
- monitor sqs eventbridge events for ec2 termination in kubernetes
- run spot instances safely in kubernetes

## When to choose
- you run Kubernetes on AWS EC2, especially EKS with Spot instances or autoscaling groups
- you need pods to drain and reschedule before instances are terminated
- you want automated cordon/drain triggered by IMDS or EventBridge/SQS events

## When to avoid
- your cluster runs on non-AWS infrastructure or non-EC2 nodes
- you use managed node groups with built-in graceful termination already configured
- you need a general-purpose Kubernetes monitoring solution rather than termination handling

## Facets
- artifact type: service
- maturity: active
- function: monitoring, deployment, workflow-automation
- domain: cloud-computing, infrastructure-as-code
- platform: go, cloud
- tags: kubernetes, aws, ec2, spot-instances, eks, node-draining, autoscaling, sqs, eventbridge, graceful-shutdown, devops, containers, docker, linux

## Member repositories
- aws/aws-node-termination-handler (main) score 85

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:32.761241+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:27:01.306067+00:00, confidence not recorded.
  - readme: https://github.com/aws/aws-node-termination-handler (fetched 2026-08-28T04:05:32.761241+00:00, sha b4058fa3b128)
  - homepage: https://aws.amazon.com/ec2 (fetched 2026-08-29T11:05:24.952779+00:00, sha 0cec0878c3ea)
  - site_page: https://aws.amazon.com/getting-started?nc2=h_dsc_aa_gs (fetched 2026-08-29T11:05:24.964220+00:00, sha f35fd0664950)
  - site_page: https://aws.amazon.com/about-aws/global-infrastructure?nc2=h_dsc_aa_gi (fetched 2026-08-29T11:05:24.965957+00:00, sha 79a446e5fbd1)
  - site_page: https://aws.amazon.com/products/developer-tools/agent-toolkit-for-aws?nc2=h_dsc_ex_s5 (fetched 2026-08-29T11:05:24.962019+00:00, sha 3cc21b596f92)
  - site_page: https://aws.amazon.com/pricing?nc2=h_pr_hub (fetched 2026-08-29T11:05:24.967947+00:00, sha e2abd01d7981)
  - site_page: https://aws.amazon.com/savingsplans?nc2=h_pr_sp (fetched 2026-08-29T11:05:24.969697+00:00, sha 9ff3c7ad93e0)
  - site_page: https://aws.amazon.com/s3/pricing?nc2=h_pr_s3 (fetched 2026-08-29T11:05:24.972131+00:00, sha 97bbf99c3793)
  - site_page: https://aws.amazon.com/bedrock/pricing?nc2=h_pr_br (fetched 2026-08-29T11:05:24.975447+00:00, sha 4ccc538a3696)
  - site_page: https://aws.amazon.com/rds/pricing?nc2=h_pr_rds (fetched 2026-08-29T11:05:24.977137+00:00, sha 538280f30c8a)
- Data as of 2026-08-30T08:39:29.467469+00:00.
