Closed jmilktea closed 2 months ago
I will gladly take a look and help here, but for that can you please create a github demo with an application and clear instructions what you are trying to do? I mean, in this way, we could clone it and see what is going on
@wind57 I have uploaded the code, please take a look https://github.com/jmilktea/spring-cloud-kubernetes
you are using a version that we no longer support. You will need to upgrade to spring cloud 3.x.x
, otherwise there is no one who will help as there are no fixes in the version that you use
It is a pity that we are still using this version. The code is also very simple, but I don’t know what went wrong. The EventBasedConfigMapChangeDetector bean is not injected into the spring container. @wind57
sorry, I can't help you, that version is out of life. unless you upgrade, no one here can do anything.
Describe the bug Dynamic refresh did not take effect. It was found that the EventBasedConfigMapChangeDetector bean was not injected into the spring container.
Sample My project is very simple. I want to implement the refresh function of k8s config modification. However, I found that it can be read when it starts, but the memory value cannot be refreshed when the k8s config map is modified. After logging, no error log was found. I can find "ConfigReloadAutoConfiguration.ConfigReloadAutoConfigurationBeans#configMapPropertyChangeEventWatcher matched" from the log, buf found that the spring container does not have EventBasedConfigMapChangeDetector this bean.What is the problem?
source code:
my application.yml config:
my application dependency:
k8s config map,I have granted the default serviceaccount the [get list watch] permission