spring-cloud-kubernetes
spring-cloud-kubernetes copied to clipboard
Configuration Watcher and Service Names
For the Configuration Watcher to be able to make a refresh call to the application actuator, it looks like the Kubernetes service name has to match the spring boot app name (and config map name) or it won't be able to locate it to make the call. Currently, our services have a naming convention that is [app-name]-svc which is causing the Configuration Watcher to skip the update because it can't find a service with the correct name. Is there another way to tell the Configuration Watcher which service to look for without having to make the names match? We are just wondering if we are going to have to change the names of all our existing services to remove the -svc suffix.
No they must match at the moment but this is a reasonable enhancement
ok, thanks for the verification Ryan!
Hey @ryanjbaxter, the newer Spring boot version over 2.3.12 does not provide /actuator/refresh
endpoint. Are you aware of it or do I miss some point?
That endpoint has existed and continues to exist for a long while now, you might need to enable it and expose it
I did as follow but still getting 404. Is it wrong? @ryanjbaxter application.yml
management:
endpoints:
web:
exposure:
include: '*'
endpoint:
restart:
enabled: true
refresh:
enabled: true
here is the full with the version below =>2.3.12 it expose 18 endpoints and with newer version only 13 EP
When I go to http://localhost:8080/actuator
I see the refresh endpoint using your example
{
"_links": {
"self": {
"href": "http://localhost:8080/actuator",
"templated": false
},
"refresh": {
"href": "http://localhost:8080/actuator/refresh",
"templated": false
}
}
}
@ryanjbaxter The reason why they are now available is that after I added the following deps this and this . AFAIU without any cloud dependency, it is not possible to get /refresh entpoint. With following pom you cannot set the /refresh
ep.
That's why we suggest you use the Spring Cloud Bom and let it manage the dependencies for you. The refresh endpoint is part of Spring Cloud Commons not Sprint Cloud Kubernetes https://docs.spring.io/spring-cloud-commons/docs/current/reference/html/#endpoints
Hey @ryanjbaxter, I see that this has been added to 2021.0.1 and 2022.0.0-M2. Just wanted to see if you guys had a ballpark estimate on when this might be implemented? Thanks!
Not sure. Any help would be appreciated though, the team is very busy.
@sdaskam1 @ryanjbaxter but we already have such support via : https://docs.spring.io/spring-cloud-kubernetes/docs/current/reference/html/#monitoring-configmaps-and-secrets, specifically:
spring.cloud.kubernetes.configmap.apps
shouldn't this issue be closed?
But I am not sure the config map watcher will take that into account. I think it was added after I implemented the config map watcher
I think it was added after I implemented the config map watcher
That is correct.
But I am not sure the config map watcher will take that into account
We have an integration test that enforces this actually: https://github.com/spring-cloud/spring-cloud-kubernetes/tree/main/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-client-configmap-event-reload-multiple-apps
Ah OK, then yes I think we can close this.