nats-io / nats-server

High-Performance server for NATS.io, the cloud and edge native messaging system.
https://nats.io
Apache License 2.0
15.45k stars 1.38k forks source link

Support for remote configuration backends #1230

Open nerdoftech opened 4 years ago

nerdoftech commented 4 years ago

Feature Requests

Add support for remote configuration backend like etcd, consul, etc. Allow configuration in these backends to take effect live.

Use Case:

Allow config changes to be orchestrated from a remote back end so that config updates are easier.

Right now changing the configuration requires config files updates on all servers and a sighup to each one. The can be real cumbersome, does not scale well, and is a slow process.

Proposed Change:

Make the configuration portions of the config a little more modular. Implement everything config related (config objects, config parses, backend clients) an internal package separate from the rest of the server code. Define an interface for the backend so that the server code does not care what the actual backend technology is.

Who Benefits From The Change(s)?

Orgs with large and or frequently changing environments.

Alternative Approaches

N/A

Other comments

I might be able to contribute at least some part of this work.

derekcollison commented 4 years ago

I believe a few NATS users may have done something like this and used the k8s secrets and volume mounts to refresh configs. Then a sidecar can have the server auto-reload the new config.

@wallyqs may have some more insight.

OneCricketeer commented 4 years ago

consul-template or similar tools could be used as a workaround