Coder Social home page Coder Social logo

alexxnica / helm-monitor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from containersolutions/helm-monitor

0.0 1.0 0.0 17 KB

Monitor K8S Helm release, rollback on metrics behavior (Prometheus, ElasticSearch)

License: MIT License

Makefile 10.06% Go 84.53% Shell 5.41%

helm-monitor's Introduction

Helm Monitor

Monitor a release, rollback to a previous version depending on the result of a PromQL (Prometheus), Lucene or DSL query (ElasticSearch).

Install

$ helm plugin install https://github.com/ContainerSolutions/helm-monitor

Usage

A rollback happen only if the number of result from the query is greater than 0.

You can find a step-by-step example in the ./examples directory.

Prometheus

Monitor the peeking-bunny release against a Prometheus server, a rollback is initiated if the 5xx error rate is over 0 for the last minute.

$ helm monitor peeking-bunny 'rate(http_requests_total{status=~"^5..$"}[1m]) > 0'

You can connect to a given Prometheus instance, by default it will connect to http://localhost:9091.

$ helm monitor --prometheus http://prometheus.domain.com:9091 \
    peeking-bunny \
    'rate(http_requests_total{status=~"^5..$"}[1m]) > 0'

ElasticSearch

Monitor the peeking-bunny release against an ElasticSearch server, a rollback is initiated if the 5xx error rate is over 0 for the last minute.

$ helm monitor peeking-bunny ''

You can connect to a given ElasticSearch instance, by default it will connect to http://localhost:9200.

$ helm monitor --prometheus http://prometheus.domain.com:9091 \
    peeking-bunny \
    'rate(http_requests_total{status=~"^5..$"}[1m]) > 0'

Development

Clone the repo, then add a symlink to the Helm plugin directory:

$ ln -s $GOPATH/src/github.com/ContainerSolutions/helm-monitor ~/.helm/plugins/helm-monitor

Install dependencies using dep:

$ dep ensure

Build:

$ go build -o helm-monitor ./cmd/...

Run:

$ helm monitor elasticsearch my-release ./examples/elasticsearch-query.json

helm-monitor's People

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.