Skip to content

A Kubernetes DaemonSet to gracefully handle EC2 Spot Instance interruptions.

License

Notifications You must be signed in to change notification settings

kniec/aws-node-termination-handler

 
 

Repository files navigation

GitHub go.mod Go version License Go Report Card Build Status Docker Pulls

AWS Node Termination Handler

The AWS Node Termination Handler is an operational DaemonSet built to run on any Kubernetes cluster using AWS EC2 Spot Instances. When a user starts the termination handler, the handler watches the AWS instance metadata service for spot instance interruptions 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.

You can run the termination handler on any Kubernetes cluster running on AWS, including clusters created with Amazon Elastic Kubernetes Service.

Getting Started

The termination handler consists of a ServiceAccount, ClusterRole, ClusterRoleBinding, and a DaemonSet. All four of these Kubernetes constructs are required for the termination handler to run properly.

You can create and run all of these at once on your own Kubernetes cluster by running the following command:

kubectl apply -f https://raw.github.com/aws/aws-node-termination-handler/master/node-termination-handler.yaml

By default the termination handler will run on all nodes in your cluster, but will only cordon and drain your Spot instances upon receiving a termination notification.

Development

If you would like to build and run the project locally you can follow these steps:

Clone the repo:

git clone https://github.com/aws/aws-node-termination-handler.git

Build the latest version of the docker image:

make docker-build

Communication

  • Found a bug? Please open an issue.
  • Have a feature request? Please open an issue.
  • Want to contribute? Please submit a pull request.

Contributing

Contributions are welcome! Please read our guidelines and our Code of Conduct

License

This project is licensed under the Apache-2.0 License.

About

A Kubernetes DaemonSet to gracefully handle EC2 Spot Instance interruptions.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 49.1%
  • Go 43.7%
  • Dockerfile 5.0%
  • HCL 1.3%
  • Makefile 0.9%