Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Worker re-deployment at service restart causes worker settings to revert to defaults #24

Closed
dreary-ennui opened this issue Dec 25, 2023 · 5 comments · Fixed by #30
Closed

Comments

@dreary-ennui
Copy link

dreary-ennui commented Dec 25, 2023

I set up CloudFlare Logpush on the worker and was ingesting the worker logs to my local Elastic instance for statistics and log analysis. Was working great.

Restarted the system the worker was on, the worker re-deployed, CloudFlare Logpush is now disabled.

Looks like the worker re-deploys its infrastructure every time the service starts. Because of this, worker settings do not persist across service restarts.

Proposing one of the following solutions:

  1. Workers only re-deploy when necessary (would have to figure out how to tell that?) and can use existing deployments, so customizations to the workers (and workers themselves?) persist across service restarts
  2. Service reads existing worker settings prior to cleanup and sets them back after re-deployment
  3. Service provides worker options management in config yml

I'm sure there are other ways to tackle this, these were just the first things that came to mind.

This impacted me for Logpush settings, but this probably impacts other worker settings: CPU limit, usage model, placement, etc.

@dreary-ennui
Copy link
Author

@LaurenceJJones just wondering if Crowdsec has reviewed this issue yet. Thanks!

@LaurenceJJones
Copy link
Contributor

@LaurenceJJones just wondering if Crowdsec has reviewed this issue yet. Thanks!

Sorry with holidays and launch of 1.6 we havent been able to review it yet.

@LaurenceJJones
Copy link
Contributor

LaurenceJJones commented Feb 13, 2024

Stated looking into it, we should provide additional params to the zone worker

from this struct https://github.com/cloudflare/cloudflare-go/blob/ffa96c9e3b43bfe62c918a56536c2b6ab2c55003/workers.go#L24-L65

https://github.com/crowdsecurity/cs-cloudflare-worker-bouncer/blob/fbedd358b49a088dcac7b5315ca6a48d4da9fdeb/pkg/cloudflare/cloudflare.go#L203C1-L214C4

I dont know cloudflare much but all the docs are pointing it to be as simple as, allowing you to set true/false 🤷🏻

@dreary-ennui
Copy link
Author

allowing you to set true/false 🤷🏻

I'd be perfectly happy with an option in the bouncer config .yml that I can just set to Logpush: true

@dreary-ennui
Copy link
Author

@LaurenceJJones Hey Laurence - sorry to bug you :) Just wondering if this is on the radar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants