mr-karan / calert

🔔 Send alert notifications to Google Chat via Prometheus Alertmanager
MIT License
158 stars 58 forks source link

Implement leader election #65

Open aslafy-z opened 1 year ago

aslafy-z commented 1 year ago

The thread memory feature does not work well when using multiple replicas. Implementing leader election and forward inbound requests to the leader could solve this issue.

mr-karan commented 1 year ago

I think using redis would be an easier approach than implementing leader elections in this tiny simple app.

h4wkmoon commented 1 year ago

I think it is easier to add leaderelection, which is a kubernetes standard than add a redis client in your app, and make every query read or write to the redis. But I'm not a skilled dev. You can find example of that, in kyverno source code, for instance. From a "user" perpective, I would prefer that calert use election than having to deploy any additional redis pods. From an architecture perpective, one would want to run redis in ha, to avoid a spof. This is getting too heavy for calert.

If a spof is acceptable, then we can run calert on a single pod.