When using @hashicorp's excellent Serf orchestration tool, you typically configure a handler for each type of event you expect to encounter (more about events and handlers here). To change handler configuration, one must update the Serf configuration and reload the agent with a SIGHUP or a restart.
Thanks to the flexibility and open-endedness Serf offers for configuring and executing handlers, we can achieve similar functionality by configuring only a single "router" handler, which we will never need to update. This removes the orchestration work of reloading the agents by allowing you to simply drop new executables with predictable names into a directory.
You can name the handler executables by event type (e.g. member-join
). User events get prefixed with
user-
(user-deploy
, user-app-reload
, etc.).
What you will end up with is a directory structure that looks like this:
$ tree /etc/serf
/etc/serf
└── handlers
├── member-failed
├── member-join
├── member-leave
├── member-update
├── user-deploy
└── user-app-reload