Skip to content

Commit f341d80

Browse files
committed
improve wording about traefik secret
1 parent d11cec0 commit f341d80

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

crowdsec-docs/unversioned/bouncers/traefik.mdx

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,18 @@ helm upgrade --install traefik traefik/traefik -n traefik --create-namespace -f
196196

197197
## Store the Traefik bouncer key in a Kubernetes secret
198198

199-
The practical approach is to choose a fixed key, store it in a Kubernetes
200-
secret, and force `BOUNCER_KEY_traefik` from `lapi.env` with
201-
`valueFrom.secretKeyRef`.
199+
The practical approach is to choose a fixed shared key and store it in
200+
Kubernetes secrets instead of hardcoding it in Helm values.
201+
202+
Two secrets are needed because CrowdSec and Traefik run in different
203+
namespaces:
204+
205+
- In the `crowdsec` namespace, CrowdSec LAPI reads `BOUNCER_KEY_traefik` from
206+
the `crowdsec-keys` secret.
207+
- In the `traefik` namespace, Traefik mounts the same key from the
208+
`crowdsec-bouncer-key` secret as a file.
209+
210+
Both secrets must contain the same `BOUNCER_KEY_traefik` value.
202211

203212
Create or update the secrets used by CrowdSec LAPI and Traefik:
204213

@@ -247,8 +256,8 @@ Apply the CrowdSec release again:
247256
helm upgrade --install crowdsec crowdsec/crowdsec --namespace crowdsec --create-namespace -f crowdsec-values.yaml
248257
```
249258

250-
The second secret of the `crowdsec-keys.yaml` is meant for further use in the
251-
traefik configuration. It will be described later on.
259+
The `crowdsec-bouncer-key` secret in the `traefik` namespace is used later when
260+
mounting the key into the Traefik pod.
252261

253262
## Verify CrowdSec LAPI access
254263

0 commit comments

Comments
 (0)