fix(crowdsec): make Reloader watch the edge bouncer key too
Found by the pr-review bot on #751, and it is the exact failure this design was written to avoid. BOUNCER_KEY_edge is consumed as an env var from a secretKeyRef, and env is fixed at pod start. The Reloader annotation listed only crowdsec-bouncer-key, so a rotation of the edge key would update OpenBao, sync into the Secret, and reach the hosts through the Ansible play — while the LAPI kept the old value in its environment and went on trusting the old key. The bouncers would then present the new one and get 401s, at exactly the moment the rotation was supposed to be seamless. The comment directly above that annotation already stated the rule — "it's an env-var secret, so a restart is required to pick up a rotated key". I added a second env-var secret and did not extend the list. Comma-separated, matching shelly-manager-deployment.yaml. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -116,10 +116,18 @@ spec:
|
||||
requests:
|
||||
cpu: 50m
|
||||
podAnnotations:
|
||||
# Reloader restarts the LAPI when crowdsec-bouncer-key changes (it's an
|
||||
# env-var secret, so a restart is required to pick up a rotated key). See
|
||||
# Reloader restarts the LAPI when either bouncer key changes. Both are
|
||||
# consumed as env vars from a secretKeyRef, and env is fixed at pod
|
||||
# start — without a restart the LAPI keeps trusting the old value while
|
||||
# the bouncer already presents the new one, which is a 401 at exactly
|
||||
# the moment a rotation is supposed to be seamless.
|
||||
#
|
||||
# crowdsec-bouncer-key rotates on a schedule, see
|
||||
# kubernetes/infrastructure/openbao/rotation/crowdsec-bouncer-key.yaml.
|
||||
secret.reloader.stakater.com/reload: crowdsec-bouncer-key
|
||||
# crowdsec-edge-bouncer-key rotates by hand together with
|
||||
# ansible/plays/install-netbird-proxy.yml; it still needs to be listed
|
||||
# here, because the LAPI side of that rotation is this env var.
|
||||
secret.reloader.stakater.com/reload: crowdsec-bouncer-key,crowdsec-edge-bouncer-key
|
||||
persistentVolume:
|
||||
data:
|
||||
# Kept OFF deliberately. The #337 attempt to set this `true` (persist
|
||||
|
||||
Reference in New Issue
Block a user