{"id":20976434,"url":"https://github.com/dasydong/aws-spot-termination-handler","last_synced_at":"2026-04-12T11:38:21.165Z","repository":{"id":120127041,"uuid":"233204032","full_name":"DasyDong/aws-spot-termination-handler","owner":"DasyDong","description":"A LightWeight Kubernetes DaemonSet to gracefully handle EC2 Spot Instance interruptions, by Go K8s.","archived":false,"fork":false,"pushed_at":"2020-01-11T13:58:16.000Z","size":23,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-01-01T09:10:55.099Z","etag":null,"topics":["aws","eks","go","kubernetes","spot-instances","spot-instances-termination"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DasyDong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-11T09:02:03.000Z","updated_at":"2020-01-31T13:32:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"9c7a6366-0f3e-42ed-b0cf-8df3dec57ee7","html_url":"https://github.com/DasyDong/aws-spot-termination-handler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DasyDong/aws-spot-termination-handler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DasyDong%2Faws-spot-termination-handler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DasyDong%2Faws-spot-termination-handler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DasyDong%2Faws-spot-termination-handler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DasyDong%2Faws-spot-termination-handler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DasyDong","download_url":"https://codeload.github.com/DasyDong/aws-spot-termination-handler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DasyDong%2Faws-spot-termination-handler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31713876,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-12T06:22:27.080Z","status":"ssl_error","status_checked_at":"2026-04-12T06:21:52.710Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","eks","go","kubernetes","spot-instances","spot-instances-termination"],"created_at":"2024-11-19T04:53:54.155Z","updated_at":"2026-04-12T11:38:21.142Z","avatar_url":"https://github.com/DasyDong.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWS Spot Termination Handler\n\nThe **Aws Spot Termination Handler** is an operational [DaemonSet](https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/) built to run on any Kubernetes cluster using AWS [EC2 Spot Instances](https://aws.amazon.com/ec2/spot/). When a user starts the termination handler, the handler watches the AWS [instance metadata service](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) for [spot instance interruptions](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-interruptions.html) within a customer's account. If a termination notice is received for an instance that’s running on the cluster, the termination handler begins a multi-step cordon and drain process for the node.\n\nYou can run the termination handler on any Kubernetes cluster running on AWS, including clusters created with Amazon [Elastic Kubernetes Service](https://docs.aws.amazon.com/eks/latest/userguide/what-is-eks.html).\n\n## What's difference with [aws-node-termination-handler](https://github.com/aws/aws-node-termination-handler/)?\nWe recommend you follow aws-node-termination-handler repo, it's more professional and scalable.  \n\nAnd current project is just a lightweight version and more easier to start, is helpful to understand termination logic for everyone \n\n## How it works\n\nEach `aws-spot-termination-handler` pod polls the notice endpoint until it returns a http status `200`. \nhttp://169.254.169.254/latest/meta-data/spot/termination-time \n\n## Getting Started\nThe termination handler consists of a [ServiceAccount](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/), [ClusterRole](https://kubernetes.io/docs/reference/access-authn-authz/rbac/), [ClusterRoleBinding](https://kubernetes.io/docs/reference/access-authn-authz/rbac/), and a [DaemonSet](https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/). All four of these Kubernetes constructs are required for the termination handler to run properly.\n\n### Kubernetes Object Files\n\nWe use Kustomize to create a master Kubernetes yaml file .\n\nRead more about Kustomize and Overlays: https://kustomize.io\n\n## Slack Notifications\nYou are able to setup a Slack incoming web hook in order to send slack notifications to a channel, notifying the users that an instance has been terminated.\n\nIncoming WebHooks require that you set the SLACK_URL environmental variable as part of your PodSpec.\n\nYou can also set SLACK_CHANNEL to send message to different slack channel insisted of default slack webhook url's channel.\n\nThe URL should look something like: https://hooks.slack.com/services/T67UBFNHQ/B4Q7WQM52/1ctEoFjkjdjwsa22934\n\nSlack Setup:\n* Docs: https://api.slack.com/incoming-webhooks\n* Setup: https://slack.com/apps/A0F7XDUAZ-incoming-webhooks\n\n```\n  env:\n    - name: NAMESPACE\n      valueFrom:\n        fieldRef:\n          fieldPath: metadata.namespace\n    - name: NODE_NAME\n      valueFrom:\n        fieldRef:\n          fieldPath: spec.nodeName\n    - name: POD_NAME\n      valueFrom:\n        fieldRef:\n          fieldPath: metadata.name\n    - name: SPOT_POD_IP\n      valueFrom:\n        fieldRef:\n          fieldPath: status.podIP\n    - name: SLACK_URL\n      value: \"https://hooks.slack.com/services/TJH26FK44/BJKR24M1C/GMYZOXmZn6Lg30nl5Hdiz23\"\n```\n## About More motification choices\nRefer a good repo [kube-spot-termination-notice-handler](https://github.com/kube-aws/kube-spot-termination-notice-handler), \n\n##  Contributing\nContributions are welcome!  \n\n## License\nThis project is licensed under the Apache-2.0 License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdasydong%2Faws-spot-termination-handler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdasydong%2Faws-spot-termination-handler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdasydong%2Faws-spot-termination-handler/lists"}