All Projects → pusher → k8s-spot-termination-handler

pusher / k8s-spot-termination-handler

Licence: Apache-2.0 License
Monitors AWS for spot termination notices when run on spot instances and shuts down gracefully

Programming Languages

Makefile
30231 projects
python
139335 projects - #7 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to k8s-spot-termination-handler

k8s-spot-price-monitor
Monitors the spot prices of instances in a Kubernetes cluster and exposes them as prometheus metrics
Stars: ✭ 43 (-61.95%)
Mutual labels:  cloud-infrastructure, spot
py-spotme
A CLI tool that creates AWS spot instances on the fly
Stars: ✭ 16 (-85.84%)
Mutual labels:  spot
binance-connector-dotnet
Lightweight connector for integration with Binance API
Stars: ✭ 77 (-31.86%)
Mutual labels:  spot
Benzaiboten-spot-trading-bot
A trading bot easy to use to be linked to your favorite exchange to automatize the trading on cryptocurrencies
Stars: ✭ 20 (-82.3%)
Mutual labels:  spot
spot price machine learning
Machine Learning for Spot Prices
Stars: ✭ 25 (-77.88%)
Mutual labels:  spot
ecs-mesh-workshop
This handy workshop help the customers to quickly launch ECS with service mesh support on top of mixed type of instance in all commercial regions (include China), and also provides hands-on tutorials with best practices. It can be customized easily as per need.
Stars: ✭ 17 (-84.96%)
Mutual labels:  spot
huobi Cpp
C++ SDK for Huobi Spot API
Stars: ✭ 56 (-50.44%)
Mutual labels:  spot
introspector
A schema and set of tools for using SQL to query cloud infrastructure.
Stars: ✭ 61 (-46.02%)
Mutual labels:  cloud-infrastructure
s3bundler
ARCHIVED - see https://aws.amazon.com/about-aws/whats-new/2019/04/Amazon-S3-Introduces-S3-Batch-Operations-for-Object-Management/ Amazon S3 Bundler downloads billions of small S3 objects, bundles them into archives, and uploads them back into S3.
Stars: ✭ 26 (-76.99%)
Mutual labels:  spot
huobi CSharp
CSharp SDK for Huobi Spot API
Stars: ✭ 47 (-58.41%)
Mutual labels:  spot
Aws Cdk
The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
Stars: ✭ 7,963 (+6946.9%)
Mutual labels:  cloud-infrastructure
Oauth2 Proxy
A reverse proxy that provides authentication with Google, Azure, OpenID Connect and many more identity providers.
Stars: ✭ 4,511 (+3892.04%)
Mutual labels:  cloud-infrastructure
oec-ng
OEC 现货交易助手(前端)
Stars: ✭ 14 (-87.61%)
Mutual labels:  spot

K8s Spot Termination Handler

This repository has been DEPRECATED and we recommend using the official AWS Node Termination Handler from AWS instead. See #14 regarding ownership of this repository.

Table of contents

Introduction

The K8s Spot Termination handler watches the AWS metadata service when running on Spot Instances.

When a Spot Instance is due to be terminated, precisely 2 minutes before it's termination a "termination notice" is issued. The K8s Spot Termination Handler watches for this and then gracefully drains the node it is running on before the node is taken away by AWS.

Usage

Deploy to Kubernetes

A docker image is available at quay.io/pusher/k8s-spot-termination-handler. These images are currently built on pushes to master. Releases will be tagged as and when releases are made.

Sample Kubernetes manifests are available in the deploy folder.

To deploy in clusters using RBAC, please apply all of the manifests (Daemonset, ClusterRole, ClusterRoleBinding and ServiceAccount) in the deploy folder but uncomment the serviceAccountName in the Daemonset.

Requirements

For the K8s Termination Handler to schedule correctly; you will need an identifying label on your spot instances.

We add a label node-role.kubernetes.io/spot-worker to our spot instances and hence this is the default value in the node selector of the Daemonset.

nodeSelector:
  "node-role.kubernetes.io/spot-worker": "true"

To achieve this, add the following flag to your Kubelet:

--node-labels="node-role.kubernetes.io/spot-worker=true"

Configuration

To define any custom parameters to the drain command you can use DRAIN_PARAMETERS environment property. If not defined, default parameters are --grace-period=120 --force --ignore-daemonsets.

env:
  - name: DRAIN_PARAMETERS
    value: '--grace-period=120 --force --ignore-daemonsets --delete-local-data'

Related

  • K8s Spot Rescheduler: Move nodes from on-demand instances to spot instances when space is available.

Communication

  • Found a bug? Please open an issue.
  • Have a feature request. Please open an issue.
  • If you want to contribute, please submit a pull request

Contributing

Please see our Contributing guidelines.

License

This project is licensed under Apache 2.0 and a copy of the license is available here.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].