Skip to content

Commit e79ff0b

Browse files
authored
Merge branch 'master' into structured-output-changes
2 parents 225e363 + 5ffa178 commit e79ff0b

1 file changed

Lines changed: 41 additions & 18 deletions

File tree

docs/setup-robusta/configuration-secrets.rst

Lines changed: 41 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,55 @@ As an alternative, Robusta can pull secret values from Kubernetes secrets.
1111
Pulling Values from Kubernetes Secrets
1212
--------------------------------------------------
1313

14-
Robusta can pull values from Kubernetes secrets for:
14+
Robusta supports loading sensitive values from Kubernetes Secrets using environment variables.
15+
This works for most configuration values, including sinks, globalConfig, and custom_playbooks.
1516

16-
* Sink Configuration
17-
* Global Config
18-
* Action Parameters
17+
Step-by-Step Example: Inject a Grafana API Key
18+
==================================================
19+
Let's walk through an example where a Grafana API key is stored in a Kubernetes Secret and used in Robusta's configuration.
20+
21+
**1. Create the Kubernetes Secret**
22+
23+
First, create a Secret named ``my-robusta-secrets`` with the key ``secret_grafana_key``:
24+
25+
.. code-block:: bash
26+
27+
kubectl create secret generic my-robusta-secrets \
28+
--from-literal=secret_grafana_key=YOUR_GRAFANA_API_KEY
29+
30+
**2. Reference the Secret as an Environment Variable in Helm**
31+
32+
Add the following to your Helm values (generated_values.yaml):
1933

20-
To do so, first define an environment variable based on a Kubernetes secret. Add to Robusta's Helm values:
2134

2235
.. code-block:: yaml
2336
24-
runner:
25-
additional_env_vars:
26-
- name: GRAFANA_KEY
27-
valueFrom:
28-
secretKeyRef:
29-
name: my-robusta-secrets
30-
key: secret_grafana_key
37+
runner:
38+
additional_env_vars:
39+
- name: GRAFANA_KEY
40+
valueFrom:
41+
secretKeyRef:
42+
name: my-robusta-secrets
43+
key: secret_grafana_key
3144
45+
# if you're configuring a secret for HolmesGPT it would be:
46+
holmes:
47+
additionalEnvVars:
48+
- name: GRAFANA_KEY
49+
valueFrom:
50+
secretKeyRef:
51+
name: my-robusta-secrets
52+
key: secret_grafana_key
3253
33-
Then reference that environment variable in other Helm values using the special ``{{ env.VARIABLE }}`` syntax:
54+
**3. Use the Environment Variable in Robusta Config**
55+
56+
You can now reference the environment variable elsewhere in your configuration using the ``{{ env.VARIABLE_NAME }}`` syntax:
3457

3558
.. code-block:: yaml
3659
37-
globalConfig:
38-
grafana_api_key: "{{ env.GRAFANA_KEY }}"
39-
grafana_url: http://grafana.namespace.svc
4060
41-
Finally, make sure the Kubernetes secret actually exists. In this example, create a Secret named ``my-robusta-secrets``
42-
with a ``secret_grafana_key`` value inside.
61+
globalConfig:
62+
grafana_api_key: "{{ env.GRAFANA_KEY }}"
63+
grafana_url: http://grafana.namespace.svc
64+
65+
This setup keeps sensitive values out of your Helm files and version control, while still allowing them to be dynamically injected at runtime.

0 commit comments

Comments
 (0)