From 6f2676c2674915777a694d8faa11df389a1b5670 Mon Sep 17 00:00:00 2001 From: Leon <82407168+sed-i@users.noreply.github.com> Date: Mon, 16 May 2022 13:58:19 +0000 Subject: [PATCH] Add pasteable commands for promql-transform (#275) --- CONTRIBUTING.md | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 11704934..6da91f80 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -59,8 +59,8 @@ $ charmcraft pack ### Deploy -There are two ways of deploying the prometheus-k8s operator, with and without -promql-transform. Deploying the charm without PromQL Transform means you won't +There are two ways of deploying the prometheus-k8s operator, with and without +promql-transform. Deploying the charm without PromQL Transform means you won't get any Juju topology labels injected into your alert rule expressions. #### Without PromQL Transform @@ -73,10 +73,18 @@ $ juju deploy \ #### With PromQL Transform -Place the binary of your selected promql-transform version in the root of the prometheus-k8s -charm directory. Official binaries are available from the +Place the binary of your selected promql-transform version in the root of the +prometheus-k8s charm directory. Official binaries are available from the [promql-transform repository](https://github.com/canonical/promql-transform). +For example: + +```bash +$ wget -O promql-transform https://github.com/canonical/promql-transform/releases/download/rev6/promql-transform-amd64 +``` + +Then pass the downloaded file as a resource to `juju deploy`: + ```bash $ juju deploy \ ./prometheus-k8s_ubuntu-20.04-amd64.charm \ @@ -84,6 +92,14 @@ $ juju deploy \ --resource promql-transform-amd64=./promql-transform ``` +Similarly, to upgrade the charm, + +```bash +juju refresh \ + --path=./prometheus-k8s_ubuntu-20.04-amd64.charm \ + --resource promql-transform-amd64=./promql-transform +``` + ## Linting Flake8 and black linters may be run to check charm and test source code using the command