javaspring-bootspring-boot-actuatorspring-boot-admin

Spring Boot Admin : how to register a micro server into admin server without discovery in kubernetes


i have a spring boot admin server in my kubernetes cluster and i want to register a micro server into spring boot admin

they are in the same namespace and i already use svc name to set the client url

spring
  boot:
    admin:
      client:
        url: http://myadmin-service-svc:8080   #admin server address

now the admin server can get the pods of my service but their status are offline

the exception and message are

exception
org.springframework.web.reactive.function.client.WebClientRequestException
message
Failed to resolve 'my-service-deploy-58df8554f9-9g4k4' [A(1)] after 2queries ; nested exception is java.net.UnknownHostException: Failed to resolve 'my-service-deploy-58df8554f9-9g4k4' [A(1)] after 2 queries

this is the screenshot:

problems screenshot

i think the url is right because they are registered in admin server and the problem may be the enternet rules?

and i have confirmed that I have opened all management endpoints

management:
  endpoint:
    health:
      show-details: always
  endpoints:
    jmx:
      exposure:
        include: "*"
    web:
      exposure:
        include: "*"

Solution

  • It seems that the Spring Boot Admin server cannot resolve the host names of the client pods. Please try to tell it to use the IP instead by setting the following property in the clients:

    spring.boot.admin.client.instance.service-host-type=IP