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.
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.
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
- Found a bug? Please open an issue.
- Have a feature request? Please open an issue.
- Want to contribute? Please submit a pull request.
Contributions are welcome! Please read our guidelines and our Code of Conduct
This project is licensed under the Apache-2.0 License.