This is my personal gitlab instance. Feel free to browse my stuff: https://gitlab.greeson.xyz/users/highsaltlevels/projects

Add leader election to saltbot

David Greeson requested to merge improvements into master

What/Why

I want to be able to have several replicas of saltbot, so since I'm deploying saltbot into a kubernetes cluster and already making use of configmaps, I might as well just add leader election to "actived" and "deactivated" saltbots.

The "actived" salt will watch for commands and run the messenger goroutine, and all other "deactivated" saltbots will wait to acquire the leader lock and do nothing else until then.

I also wanted to add a TCP socket server in there so that I can have proper liveness probes and health checks.

Merge request reports