Skip to content

Have an config reloader endpoint #71

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

Closed
alexppg opened this issue Dec 1, 2019 · 8 comments · Fixed by #174
Closed

Have an config reloader endpoint #71

alexppg opened this issue Dec 1, 2019 · 8 comments · Fixed by #174
Assignees
Labels
Hacktoberfest help wanted Extra attention is needed Improvement Not a bug but... could be better

Comments

@alexppg
Copy link
Member

alexppg commented Dec 1, 2019

Is your feature request related to a problem? Please describe.
Sometimes you have a microservice which you want to change it's configuration. You could make the k8s deployment to recreate the cluster, but that wouldn't be need if the microservice had an endpoint which reloaded the configuration by itself.

Describe the solution you'd like
Implement an endpoint, for example /-/reload that will re-read the configuration.

@avara1986 avara1986 added help wanted Extra attention is needed Improvement Not a bug but... could be better labels Dec 2, 2019
@miguelgrubin miguelgrubin self-assigned this Dec 13, 2019
@avara1986
Copy link
Member

Created the method Microservice.reload() in PR #83. Next step, create the endpoint 💪

@avara1986
Copy link
Member

@alexppg suggested: add a callback parameter to Microservice.reload() to expand the reload options 👍

@avara1986
Copy link
Member

avara1986 commented Sep 19, 2020

Instruction:

Create an endpoint like the Healthcheck and call Microservice.reload()

@lcd1232
Copy link
Contributor

lcd1232 commented Oct 1, 2020

I'll do this

@alexppg
Copy link
Member Author

alexppg commented Oct 5, 2020

@avara1986 with the development done, is possible to execute arbitrary orders when the endpoint is fetched? Like the example we talked, if I implement a ms that uses elasticsearch for example, and I reload the configuration, I might need to recreate the connection. Could I do it right now?

@avara1986
Copy link
Member

Hi @alexppg, I think so,

The reload method has this code:

    def reload_conf(self):
        self.delete_services()
        self.config.reload()
        self.services = []
        self.init_services()
        self.crypt.config.reload()
        self.create_app()

and create_app method initialize Flask and init_libs. I suppose that your microservices initialize the configuration in init_libs, is it correct? If it's true, the elasticsearch connexion will be reloaded too 😄

@alexppg
Copy link
Member Author

alexppg commented Oct 16, 2020

Oh, I see. That makes sense. I don't see it documented, is it? If not, I'll create an issue. @avara1986

@avara1986
Copy link
Member

avara1986 commented Oct 16, 2020

good point, We add this functionality but we need to document it 👍

your suggestions always are very good, Thanks a lot @alexppg :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hacktoberfest help wanted Extra attention is needed Improvement Not a bug but... could be better
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants