Skip to content
A Kubernetes DaemonSet to gracefully handle EC2 Spot Instance interruptions.
Go Shell Dockerfile Makefile HCL
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cmd node-termination-grace-period configuration option added (#35) Dec 4, 2019
config update kind to v0.6.0 and move ec2-meta-data-proxy to test root (#32) Dec 4, 2019
pkg node-termination-grace-period configuration option added (#35) Dec 4, 2019
test
.dockerignore update kind to v0.6.0 and move ec2-meta-data-proxy to test root (#32) Dec 4, 2019
.gitignore
.travis.yml update build to deploy releases (#27) Nov 26, 2019
BUILD.md Test Updates (#15) Nov 13, 2019
CODE_OF_CONDUCT.md Initial commit for aws node termination handler Nov 4, 2019
CONTRIBUTING.md Initial commit for aws node termination handler Nov 4, 2019
Dockerfile re-structure into go packages (#33) Dec 3, 2019
LICENSE Initial commit for aws node termination handler Nov 4, 2019
Makefile
NOTICE Initial commit for aws node termination handler Nov 4, 2019
README.md
THIRD_PARTY_LICENSES Initial commit for aws node termination handler Nov 4, 2019
go.mod
go.sum Test Updates (#15) Nov 13, 2019

README.md

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 -k 'https://github.com/aws/aws-node-termination-handler/config/base?ref=master'

By default, the aws-node-termination-handler will run on all of your nodes (on-demand and spot). If your spot instances are labeled, you can configure aws-node-termination-handler to only run on your labeled spot nodes. If you're using the tag lifecycle=Ec2Spot, you can run the following to apply our spot-node-selector overlay:

kubectl apply -k 'https://github.com/aws/aws-node-termination-handler/config/overlays/spot-node-selector?ref=master'

If you're using a different key/value tag to label your spot nodes, you can write your own overlay to set a spot-node-selector while still receiving updates of the base kubernetes resource files. See our spot-node-selector overlay for an example.

Helm

The helm chart for this project is located in the eks-charts repo. For instructions on how to install/configure the chart see the project's README.

Building

For build instructions please consult BUILD.md.

Communication

  • Found a bug? Please open an issue.
  • Have a feature request? Please open an issue.
  • Want to contribute? Please submit a pull request.
  • Ask a question or chat with us in the Kubernetes Slack #provider-aws channel

Contributing

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

License

This project is licensed under the Apache-2.0 License.

You can’t perform that action at this time.