Spring boot admin listing kubernetes internal urls. Not able to navigate to the application page

12/20/2019

Problem

  • Trying to use Spring boot admin to do a deep monitoring of spring boot micro services running in Kubernetes.
  • Spring boot admin listing the micro services but pointing to the internal IPs.

Spring boot admin application listing page showing the internal IP

Spring boot admin application listing page showing the internal IP

The application details page has almost zero info

The application details page almost zero info

Details

  • Kubernetes 1.15
  • Spring boot applications are getting discovered by Spring boot admin using Spring cloud discovery
  • spring-cloud-kubernetes version 1.1.0.RELEASE
  • The problem is that the IPs are of internal pod network and would not be accessible to the users in any real world scenario.

Any hints on how to approach this scenario ? Any alternatives ?

Also I was wondering how spring boot admin would behave in case of pods with more than one replica. I think it is close to impossible to point to a unique pod replica through ingress or node port.

Hack I am working on

If I can start another pod which exposes the Linux desktop to the end user. From a browser of this desktop, user may be able to access the pod network ips. It is just a wild thought as a hack.

-- arunvg
kubernetes
microservices
spring-boot
spring-boot-admin
spring-cloud

1 Answer

12/20/2019

Spring Boot Admin register each application/client based on its name by below property.

spring.boot.admin.client.instance.name=${spring.application.name}

If all your pods have same name it can register based on individual ips by enabling perfer-ip property (which is false by default):

spring.boot.admin.client.instance.prefer-ip=true

In your case, you want to SBA to register based on the Kubernetes load balanced url, then service-base-url property should be set the corresponding application's url.

spring.boot.admin.client.instance.service-base-url=http://myapp.com
-- Mohit Singh
Source: StackOverflow