Skip to content

Commit 9ccd26f

Browse files
committed
Document shared Prometheus auth config between runner and Holmes
When using external Prometheus with authentication and HolmesGPT enabled, users must configure the same secret twice (for the runner and Holmes). This adds documentation showing how to use a single Kubernetes Secret referenced by both components via environment variables. - Add "Sharing Prometheus Auth Between Runner and Holmes" section to configuration-secrets.rst - Add "Authentication with HolmesGPT" section to metric-providers-external.rst - Add comment in values.yaml noting the Holmes auth requirement https://claude.ai/code/session_0182WJ9kNfUzm2h12TsWH9d5
1 parent aa0145a commit 9ccd26f

3 files changed

Lines changed: 88 additions & 0 deletions

File tree

docs/configuration/metric-providers-external.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,30 @@ To use this token add the following env var to the ``runner``:
7676
prometheus_auth: "Basic dXNlcm5hbWU6cGFzc3dvcmQ="
7777
alertmanager_auth: "Basic dXNlcm5hbWU6cGFzc3dvcmQ="
7878
79+
.. _holmes-prometheus-auth:
80+
81+
Authentication with HolmesGPT
82+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
83+
84+
If you have HolmesGPT enabled (``enableHolmesGPT: true``), Holmes runs as a separate deployment and needs its own Prometheus authentication configuration. You must configure auth for both the runner (via ``globalConfig``) and Holmes (via ``holmes.toolsets``):
85+
86+
.. code-block:: yaml
87+
88+
globalConfig:
89+
prometheus_url: "https://prometheus.example.com:9090"
90+
prometheus_auth: "Basic dXNlcm5hbWU6cGFzc3dvcmQ="
91+
92+
holmes:
93+
toolsets:
94+
prometheus/metrics:
95+
enabled: true
96+
config:
97+
prometheus_url: "https://prometheus.example.com:9090"
98+
headers:
99+
Authorization: "Basic dXNlcm5hbWU6cGFzc3dvcmQ="
100+
101+
To avoid duplicating the secret in plain text, use a Kubernetes Secret and environment variables. See :ref:`Sharing Prometheus Auth Between Runner and Holmes <Managing Secrets>` for a step-by-step guide.
102+
79103
Multi-cluster Setup
80104
-------------------
81105

docs/setup-robusta/configuration-secrets.rst

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,63 @@ You can now reference the environment variable elsewhere in your configuration u
6363
grafana_url: http://grafana.namespace.svc
6464
6565
This setup keeps sensitive values out of your Helm files and version control, while still allowing them to be dynamically injected at runtime.
66+
67+
Sharing Prometheus Auth Between Runner and Holmes
68+
==================================================
69+
70+
When using an external Prometheus with authentication and HolmesGPT enabled, you need to configure the same credentials in two places:
71+
72+
- ``globalConfig.prometheus_auth`` — used by the Robusta runner
73+
- ``holmes.toolsets.prometheus/metrics.config.headers.Authorization`` — used by HolmesGPT
74+
75+
To avoid duplicating secrets in plain text, store the credential once in a Kubernetes Secret and reference it from both components:
76+
77+
**1. Create the Kubernetes Secret**
78+
79+
.. code-block:: bash
80+
81+
kubectl create secret generic prometheus-auth-secret -n robusta \
82+
--from-literal=auth="Basic dXNlcm5hbWU6cGFzc3dvcmQ="
83+
84+
**2. Reference it from both the runner and Holmes**
85+
86+
.. code-block:: yaml
87+
88+
runner:
89+
additional_env_vars:
90+
- name: PROMETHEUS_AUTH
91+
valueFrom:
92+
secretKeyRef:
93+
name: prometheus-auth-secret
94+
key: auth
95+
96+
holmes:
97+
additionalEnvVars:
98+
- name: PROMETHEUS_AUTH
99+
valueFrom:
100+
secretKeyRef:
101+
name: prometheus-auth-secret
102+
key: auth
103+
104+
**3. Use the environment variable in both configs**
105+
106+
.. code-block:: yaml
107+
108+
globalConfig:
109+
prometheus_url: "https://prometheus.example.com:9090"
110+
prometheus_auth: "{{ env.PROMETHEUS_AUTH }}"
111+
112+
holmes:
113+
toolsets:
114+
prometheus/metrics:
115+
enabled: true
116+
config:
117+
prometheus_url: "https://prometheus.example.com:9090"
118+
headers:
119+
Authorization: "{{ env.PROMETHEUS_AUTH }}"
120+
121+
This way the secret is stored once in Kubernetes and injected into both the runner and Holmes at runtime.
122+
123+
.. note::
124+
125+
Both the runner and Holmes need the environment variable injected separately because they run as separate deployments. The ``runner.additional_env_vars`` injects into the runner pod, while ``holmes.additionalEnvVars`` injects into the Holmes pod.

helm/robusta/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ automountServiceAccountToken: true
2424
enableHolmesGPT: false
2525

2626
# see https://docs.robusta.dev/master/user-guide/configuration.html#global-config and https://docs.robusta.dev/master/configuration/additional-settings.html#global-config
27+
# NOTE: If using external Prometheus with auth and HolmesGPT, you must also configure
28+
# holmes.toolsets.prometheus/metrics.config.headers.Authorization with the same credentials.
29+
# See https://docs.robusta.dev/master/setup-robusta/configuration-secrets.html for how to
30+
# avoid duplicating secrets using Kubernetes Secrets and environment variables.
2731
globalConfig:
2832
check_prometheus_flags: true
2933
grafana_url: ""

0 commit comments

Comments
 (0)