Search code examples
javakubernetesspring-boot-admin

SpringBoot Admin - Kubernetes - server to override client URL


Question regarding SpringBot admin deployed on Kubernetes.

The SpringBoot Admin server starts fine.

Then, the SpringBoot app (client) starts fine.

The SpringBoot client application correctly registered himself. (Can see

[gistrationTask1] d.c.b.a.c.r.ApplicationRegistrator       : Application registered itself as 32a6bf789a7d

in the logs of the client)

However, the server "is seeing a wrong client address"

[,9e0816eadf7218f9,9e0816eadf7218f9,true] 47 --- [or-http-epoll-1] d.c.b.a.server.services.StatusUpdater    : Couldn't retrieve status for Instance(id=32a6bf789a7d, version=0, registration=Registration(name=myservice, managementUrl=https://{some wrong IP here}:9010/, healthUrl=https://{some wrong IP here}:9010/__health, serviceUrl=https://{some wrong IP here}:9010/, source=http-api), registered=true, statusInfo=StatusInfo(status=UNKNOWN, details={}), statusTimestamp=2020-11-08T05:15:00.451717Z, info=Info(values={}), endpoints=Endpoints(endpoints={health=Endpoint(id=health, url=https://{some wrong IP here}:9010/__health)}), buildVersion=null, tags=Tags(values={}))

io.netty.channel.AbstractChannel$AnnotatedConnectException: finishConnect(..) failed: Connection refused: /{some wrong IP here}:9010
    Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Error has been observed at the following site(s):
    |_ checkpoint ? Request to GET health [DefaultWebClient]
Stack trace:
Caused by: java.net.ConnectException: finishConnect(..) failed: Connection refused
    at io.netty.channel.unix.Errors.throwConnectException(Errors.java:124) ~[netty-transport-native-unix-common-4.1.53.Final.jar!/:4.1.53.Final

I can see an IP, in my example {some wrong IP here}. But the IP is wrong, hence the connection refused.

The {some wrong IP here} should be like some POD level IP of Kubernetes, inaccessible.

How can I have SpringBoot admin client register himself with the correct IP (the one configured from the Kubernetes Service)

How can I manually override in the server to a correct IP? I.e tell SpringBoot admin server where the connect health endpoint is?

How can I have SpringBoot admin server discover the client correctly please?

Thank you for your help


Solution

  • After research, there are properties exposed from SpringBoot Admin to achieve this:

    spring.boot.admin.client.instance.health-url=https://my-override-kubernetes.com/health
    spring.boot.admin.client.instance.management-url=https://my-override-kubernetes.com.com/health
    spring.boot.admin.client.instance.service-url=https://my-override-kubernetes.com.com/health