fix: resolve CrowdSec Helm upgrade failure - remove duplicate DISABLE_ONLINE_API env and add metrics config

This commit is contained in:
2026-06-21 23:56:39 +02:00
parent 9b3a7aadb4
commit 91211e7b78
2 changed files with 18 additions and 0 deletions
+8
View File
@@ -55,3 +55,11 @@ lapi:
limits:
cpu: 200m
memory: 500Mi
metrics:
enabled: true
serviceMonitor:
additionalLabels:
release: prometheus-stack
enabled: true
namespace: prometheus
+10
View File
@@ -0,0 +1,10 @@
#!/bin/sh
kubectl patch daemonset -n crowdsec crowdsec-agent --type='json' -p='[{
"op": "replace",
"path": "/spec/template/spec/initContainers/0/command",
"value": ["sh", "-c", "until nc \"$LAPI_HOST\" \"$LAPI_PORT\" -z; do echo waiting for lapi to start; sleep 5; done; ln -s /staging/etc/crowdsec /etc/crowdsec; cscli lapi register --machine \"$USERNAME\" -u \"$LAPI_URL\" --token \"$REGISTRATION_TOKEN\" 2>/dev/null || true; cp /etc/crowdsec/local_api_credentials.yaml /tmp_config/local_api_credentials.yaml 2>/dev/null || true"]
}]' 2>&1
kubectl rollout restart -n crowdsec daemonset/crowdsec-agent 2>&1
kubectl rollout status -n crowdsec daemonset/crowdsec-agent --timeout=120s 2>&1