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

Reload fixed_users config with API #259

Open
v1ack opened this issue Oct 23, 2024 · 2 comments
Open

Reload fixed_users config with API #259

v1ack opened this issue Oct 23, 2024 · 2 comments

Comments

@v1ack
Copy link

v1ack commented Oct 23, 2024

As for now, to reload config with fixed users, we need to restart entire service.
It's possible to make http handler to apiserver.config.basic.BasicConfig.reload function, to call it after config update, so new users will be able to auth without service restart

@v1ack v1ack changed the title Reload config with API Reload fixed_users config with API Oct 23, 2024
@v1ack
Copy link
Author

v1ack commented Oct 24, 2024

@jkhenning hey, can also you comment that?

@jkhenning
Copy link
Member

Hi @v1ack, I believe the issue is not so simple, since in some places the loaded config object might be cached (or parts of the configuration might be cached or stored in-memory), which might take quite some time to test and figure out.

In general, since we're using gunicorn to handle the worker processes for the apiserver component, and since gunicorn reloads these processes periodically anyway, a much simpler solution after updating the configuration files is to force the process reload in gunicorn using the kill -HUP command on the main gunicorn process inside the container - this can be automated by a script (i.e. execing into the container, finding the root gunicorn pid and issuing the command) - this would be the fastest solution and also the safest one (the processes will take a very short time to restart and gunicorn will wait with new HTTP requests for the workers to respond).

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

No branches or pull requests

2 participants