gnmic icon indicating copy to clipboard operation
gnmic copied to clipboard

Allow reload of config file at runtime

Open melkypie opened this issue 2 years ago • 3 comments

Currently if you run gnmic in docker or kubernetes, the only way to reload the configuration is by restarting the container/pod.

This could be triggered the same way as prometheus allows you to reload a config file, e.g., sending a SIGHUP to the process or sending a POST request to a url.

melkypie avatar Apr 05 '22 12:04 melkypie

This has been brought up before, the complexity here is in going through the targets and figuring out if there was any change, reestablishing the gRPC connection if needed, updating subscriptions if needed, etc...

Prometheus pulls data from targets, so it's just a matter of using the new configuration on the next scrape.

It is more simple to just restart the gnmic instance, considering that there would be other instances to take over its targets in case something goes wrong.

Open to other opinions or a better way of looking at this.

karimra avatar Apr 05 '22 15:04 karimra

Maybe in case of Kubernetes, it would be easier to implement a readiness check so that Kubernetes only restarts another pod after the first pod is ready and is scraping all it's assigned targets?

melkypie avatar Apr 05 '22 15:04 melkypie

Can you details what you mean by "first pod" here ? What would be the criteria for a pod to be "ready" ? It would be helpful if you can details which configuration you want to update dynamically, without restarting

karimra avatar Apr 05 '22 15:04 karimra