crowdsec_manager icon indicating copy to clipboard operation
crowdsec_manager copied to clipboard

Feature request: Docker swarm support

Open acheslow opened this issue 3 months ago • 1 comments

Current Behavior Currently only container names are supported for CROWDSEC_CONTAINER_NAME, TRAEFIK_CONTAINER_NAME, etc.

Docker swarm generates unique container names every time a stack is deployed; e.g. crowdsec_crowdsec.d50tqboyg9quhk8hm5316tsl3.wmf7dapml06en9gmx3y1z1439

It is possible to run crowdsec_manager on swarm by updating the *_CONTAINER_NAME variables every time the crowdsec or traefik stacks are redeployed, but this is a cumbersome manual process.

Desired Behavior Ideally, crowdsec manager would also support swarm stacks by referencing the service names rather than the container names. The service names remain constant through redeploys; e.g. crowdsec_crowdsec, traefik_traefik, etc. These could be referenced statically in env variables like CROWDSEC_SERVICE_NAME, TRAEFIK_SERVICE_NAME, etc.

Reference https://github.com/hhftechnology/crowdsec_manager/issues/98#issue-4333198559

acheslow avatar Aug 15 '26 17:08 acheslow

I just got bit by this as well. I spent a couple hours trying to figure out why it wasn't seeing my 'crowdsec' container event though they're in the same network and my crowdsec container's hostname is literally 'crowdsec'. I'm so used to containers just knowing how to do this (in a swarm) that it didn't even cross my mind this one didnt, lol.

level=info
time=2026-08-22T03:02:53Z
msg=Database initialized
path=./data/settings.db
level=info
time=2026-08-22T03:02:53Z
msg=History database initialized
path=./data/history.db
level=info
time=2026-08-22T03:02:53Z
msg=Multi-host Docker client initialized with single default host
level=info
time=2026-08-22T03:02:53Z
msg=Checking prerequisites...
level=info
time=2026-08-22T03:02:53Z
msg= Docker daemon is running
level=fatal
time=2026-08-22T03:02:53Z
msg=Prerequisite check failed
error=required container not found: crowdsec
Container stopped

YouveGotMeowxy avatar Aug 22 '26 03:08 YouveGotMeowxy