spring boot admin does not detect service after restarting spring boot admin
See original GitHub issuespring boot 2.4.3 spring cloud 2020.0.1 spring boot admin 2.4.0
I have an environment with two services. They are exchange-api-test and admin-test(is a spring-boot-admin project) They all are deployed and managed by Docker images and Kubernetes. I also use admin-test in order to monitor them all and spring-cloud-kubernetes to discover all the services automatically.
It works perfectly whenever I restart the exchange-api-test project (kubectl rollout restart deployment exchange-api-deployment), admin-test discovers every service. My problem comes when I restart admin-test project(kubectl rollout restart deployment admin-deployment), exchange-api-test is shown as OFFLINE in the SBA and it does not change its status. applaction.yml (in admin-test project)
server: port: 8080 spring: profiles: active: test application: name: admin-${spring.profiles.active} cloud: kubernetes: discovery: all-namespaces: true service-labels: env: ${spring.profiles.active} reload: enabled: true management: endpoints: web: exposure: include: "*" endpoint: health: show-details: always
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:7 (2 by maintainers)
Top GitHub Comments
We also hit this bug after upgrading to SBA 2.4.0 using Spring Cloud Kubernetes Discovery. I noticed that events got “lost” and as such, certain
AbstractEventHandler
s (likeEndpointDetectionTrigger
) were not triggered at all. Subsequently, services are reported as down or endpoints are not discovered.I traced this back to
InstanceEventPublisher
, where after the Reactor Core upgrade to 3.4.x, the new sinks API was used. However, the new sinks API has one major difference with the previous API (UnicastProcessor
), in the sense that serialization (i.e. concurrent access) is not handled for you. Instead, the emission fails silently (addingorThrow()
will reveal the errors).I can fix it locally by either retrying the emission (using a
EmitFailureHandler
) or by addingsynchronized
toInstanceEventPublisher#publish
. Happy to provide a PR for this if you want, @SteKoe.Hi @star4j, have you added
@EnableScheduling
to the main Application class of your Spring Boot Admin implementation (see #1506)?See also: https://cloud.spring.io/spring-cloud-kubernetes/1.1.x/reference/html/#secrets-propertysource