Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(config): autoreload on config changes #2722

Merged
merged 1 commit into from
Oct 24, 2023

Conversation

SkalaNetworks
Copy link
Contributor

This merge request adds a new flag to gobgpd to enable the detection of changes in the configuration file, triggering an auto reload.

This is especially useful in containerized environments, like Kubernetes, where pushing a new configuration through ConfigMaps will overwrite the content of the configuration file in the container, but not trigger a reload because GoBGP doesn't know about the changes.

The new flag is '-a' or '--config-auto-reload'. I'm simply using Viper's ability to detect new configurations and emulating a SIGHUP signal.

@mbanatt
Copy link

mbanatt commented Oct 16, 2023 via email

@fujita
Copy link
Member

fujita commented Oct 24, 2023

Why sending a signal is difficult for reloading?

@SkalaNetworks
Copy link
Contributor Author

@fujita not every deployment technology can send signals by itself on a config change, Kubernetes could theoretically send a signal through an HTTP webhook to gobgp (if it were to support it) to tell it to reload. We change the configuration of our bgp speakers quite often through GitOps, which means changing the config in the git results in a smooth automatic deployment with no manual operation.

For standard deployments (not through k8s), the alternative would be a script detecting the changes and pushing a signal to gobgp. With this PR, gobgp takes care of that by itself.

@fujita fujita merged commit 4364a26 into osrg:master Oct 24, 2023
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants