Monitor a release, rollback to a previous version depending on the result of a PromQL (Prometheus), Lucene or DSL query (ElasticSearch).
$ helm plugin install https://github.com/ContainerSolutions/helm-monitor
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.
Monitor the peeking-bunny release against a Prometheus server, a rollback is initiated if the 5xx error rate is over 0 as measured over the last 5 minutes.
$ helm monitor prometheus peeking-bunny 'rate(http_requests_total{code=~"^5.*$"}[5m]) > 0'
You can connect to a given Prometheus instance, by default it will connect to http://localhost:9090.
$ helm monitor prometheus --prometheus=http://prometheus:9090 \
peeking-bunny \
'rate(http_requests_total{code=~"^5.*$"}[5m]) > 0'
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.
Using a Lucene query:
$ helm monitor elasticsearch peeking-bunny 'status:500 AND kubernetes.labels.app:app AND version:2.0.0'
Using a query DSL file:
$ helm monitor elasticsearch peeking-bunny ./query.json
You can connect to a given ElasticSearch instance, by default it will connect to http://localhost:9200.
$ helm monitor elasticsearch --elasticsearch=http://elasticsearch:9200 \
peeking-bunny \
'status:500 AND kubernetes.labels.app:app AND version:2.0.0'
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
- Investigate tool for failure detection compared to previous time window
- Add flag for fancy graph