Git Product home page Git Product logo

kube-maintenance-typhoon's Introduction

kube-maintenance-typhoon

This script will list all the instances and search for the instances in shutting-down state and get its PrivateDnsName. This is used for removing this node from the kubernetes cluster to avoid the application down time.

Goal

We have been using the Typhoon kubernetes cluster in our environment with spot instances which works great. A few times, we faced the issue with the Spot instances being terminated due to "" error and the nodes go into the "NotReady" state and pods running on it goes into the "Terminating" state. Untill these Terminating pods are completely terminated, we cannot have new pods created which resulted in application down time. We have been using this script which will check all the running instances and checks the nodes against this list and deletes the nodes which doesn't match the running instances.

This can be scheduled as either a cron job or a aws lambda function.

prerequisites

The script will be looking for file credentials.txt which will have the aws credentails. It should be similar to the below.

[infosec]
aws_access_key_id = AKIATDAKDMFR857JE
aws_secret_access_key = bfjdcklsdcpooo32r020rf
region = eu-west-1

Usage

AWS_SHARED_CREDENTIALS_FILE="./credentials.txt" python kubemaint.py dev
Node is in the Ready State
Node is in the Ready State
Node is in the Ready State
Node is in the Ready State
Node is in the Ready State
Node is in the Ready State
Instance Terminated
192.123.1.0- Removing the node from kubernetes

kube-maintenance-typhoon's People

Contributors

vamshisiddarth avatar

Watchers

 avatar

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.