Skip to content

internet-com/helm-monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 83.7%
  • Makefile 10.5%
  • Shell 5.8%