11 lines
696 B
Bash
Executable File
11 lines
696 B
Bash
Executable File
#!/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
|