-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Configuring spring boot kubernetes watcher to use actuator/shutdown endpoint doesn’t work as expected #1772
Comments
Yes, you are correct iirc. If you are using "kubernetes config watcher image" we will only be calling This could be seen as an enhancement and we could be calling @ryanjbaxter wdyt? |
Agree I can take a look at this one |
@wind57 that could be great since refresh is insufficient for my use case, the environment is not reloaded as expected. |
without a clear example (like a github repo) where you can show us what is going on, its going to be impossible to help you. Essentially, you help us with a good sample, we help you in figuring out the problem |
Ok sure I will try to show a sample:
The config map will look like this:
The property is initialized using Now, when trying to reload the property either by hitting the /refresh manually, or by using the watcher - the property is not reloading. Only a complete shutdown will do the reload. Thanks |
can you put this into a github project that I can import easily? Also show instructions on how I should reproduce the issue please. Thank you |
Please follow this link: https://github.com/MeravYa/sample-app/tree/master/sample-app thanks |
Unfortunately, I can not even start to help you, because:
So you need to upgrade, first. |
Ok I understand. After doing further research I think my problem occurs since I'm not using config map as mount to the spring boot application pod. |
yes, as you have seen Ryan will be taking this work. |
Ok thanks a lot to both of you |
Supporting shutdown as a mode of refreshing configuration seems doable when using the config watcher in combination with HTTP because we can call the actuators However it becomes a bit more complicated when the config watcher is using Spring Cloud Bus because Bus has no concept of a "shutdown event". We would first have to add support for a shutdown even in Spring Cloud Bus and then leverage that in the config watcher. I will discuss that with the team and see what they think. |
@MeravYa I've read your use case today in the morning again, and I think that |
Hi @wind57 , |
The first step in making the shutdown use case was merged into spring-cloud-bus here spring-cloud/spring-cloud-bus#277 |
sorry for responding a bit late... I had to do a bit of changes to make the app running in my local cluster, see here And now if I run it and issue:
I see the value injected from the configmap. And the question is: what next? Because you do not have the set-up you use for the configuration watcher in the sample... So if you want to update the sample to include those steps also (exactly how to re-produce the problem), I can take a look further. Thank you. |
@wind57 for some reason I missed the README in my commit. Please view it now please, I've also added the spring boot watcher. You can either reproduce by manually triggering the refresh endpoint, or by using the config watcher. Thanks |
…n to refresh the application See spring-cloud#1772
The ability to shut down the application when the apps configuration changes via the configuration watcher was merged into main #1799 |
so your problem lies in the fact (from official docs):
So there is not much we can do about. Also, I understand why you would want for such case the But, we have support for slightly a different set-up, where things will work. If you can use Also, if you are deploying the config watcher, this would be a read you should invest time into. I hope that helps. |
Version: 3.1.3
I’m using the basic spring boot kubernetes config watcher image. When trying to set the reload strategy to shutdown - the spring boot kubernetes watcher is still using the /actuator/refresh endpoint.
I was adding this environment var to the watcher deployment:
spring.cloud.kubernetes.reload.strategy: shutdown
But when trying to change the config map, the application is only refreshed and not shuts down.
The text was updated successfully, but these errors were encountered: