From f5c97f62246671726c56fdc1926bc8c25724d9e1 Mon Sep 17 00:00:00 2001 From: Charles Korn Date: Wed, 11 Dec 2024 13:36:53 +1100 Subject: [PATCH] mimirtool: document TLS environment variables and CLI flags, and fix stutter in environment variable name (#10207) * Fix stutter in environment variable name * Document TLS environment variables and CLI flags for `mimirtool` * Add changelog entry --- CHANGELOG.md | 2 ++ docs/sources/mimir/manage/tools/mimirtool.md | 9 +++++++++ pkg/mimirtool/commands/env_var.go | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d5074bb8b8..16d0fc5254e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ ### Mimirtool +* [BUGFIX] Fix issue where `MIMIR_HTTP_PREFIX` environment variable was ignored and the value from `MIMIR_MIMIR_HTTP_PREFIX` was used instead. #10207 + ### Mimir Continuous Test ### Query-tee diff --git a/docs/sources/mimir/manage/tools/mimirtool.md b/docs/sources/mimir/manage/tools/mimirtool.md index ee78c7c7248..15e4a0f7a51 100644 --- a/docs/sources/mimir/manage/tools/mimirtool.md +++ b/docs/sources/mimir/manage/tools/mimirtool.md @@ -77,6 +77,15 @@ For Mimirtools to interact with Grafana Mimir, Grafana Enterprise Metrics, Prome | `MIMIR_API_KEY` | `--key` | Sets the basic auth password. If you're using Grafana Cloud, this variable is your API key. | | `MIMIR_TENANT_ID` | `--id` | Sets the tenant ID of the Grafana Mimir instance that Mimirtools interacts with. | +It is also possible to set TLS-related options with the following environment variables or CLI flags: + +| Environment variable | Flag | Description | +| -------------------------------- | ---------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `MIMIR_TLS_CA_PATH` | `--tls-ca-path` | Sets the path to the CA certificate to use to verify the connection to the Grafana Mimir cluster. | +| `MIMIR_TLS_CERT_PATH` | `--tls-cert-path` | Sets the path to the client certificate to use to authenticate to the Grafana Mimir cluster. | +| `MIMIR_TLS_KEY_PATH` | `--tls-key-path` | Sets the path to the private key to use to authenticate to the Grafana Mimir cluster. | +| `MIMIR_TLS_INSECURE_SKIP_VERIFY` | `--tls-insecure-skip-verify` | If `true`, disables verification of the Grafana Mimir cluster's TLS certificate. This is insecure and not recommended. | + ## Commands The following sections outline the commands that you can run against Grafana Mimir and Grafana Cloud Metrics. diff --git a/pkg/mimirtool/commands/env_var.go b/pkg/mimirtool/commands/env_var.go index 3e6187ecdb9..3cb6bea9ced 100644 --- a/pkg/mimirtool/commands/env_var.go +++ b/pkg/mimirtool/commands/env_var.go @@ -30,7 +30,7 @@ func NewEnvVarsWithPrefix(prefix string) EnvVarNames { useLegacyRoutes = "USE_LEGACY_ROUTES" authToken = "AUTH_TOKEN" extraHeaders = "EXTRA_HEADERS" - mimirHTTPPrefix = "MIMIR_HTTP_PREFIX" + mimirHTTPPrefix = "HTTP_PREFIX" ) if len(prefix) > 0 && prefix[len(prefix)-1] != '_' {