Code Monkey home page Code Monkey logo

k8s-spot-termination-handler's Introduction

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.

k8s-spot-termination-handler's People

Contributors

joelspeed avatar mthssdrbrg avatar wandera-ci avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

k8s-spot-termination-handler's Issues

Use cases

This kubernetes sport termination handler is continuously monitoring and drain the node.
During the gracefully drain the nodes mean what will happen behind the scene. will it move the workload to some other node or make a backup before a node goes away.

What's the real use case of this termination handler. Could you bit describe this.
is there any pre recorded video, It would be great.

Call for project ownership

Hello all,

It probably hasn’t gone unnoticed that this repository hasn’t seen much activity in the last 6+ months, which is due to the fact that we simply don’t have the capacity to maintain and extend it at this point.

We appreciate that the project might still be used (although we recommend people to use aws/aws-node-termination-handler instead) and thus we are looking for people that want to take over the project, both in terms of ownership (i.e. transferring the repository to a new home) and maintainership (i.e. triaging issues, reviewing pull requests, adding new features, etc).

In the case that no such event occurs we plan on archiving the repository in a week from now, on 2020-11-16 (i.e. it will still be here on GitHub but read-only).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.