2

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
  • 1,209
  • 1
  • 20
  • 31

1 Answers1

6

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
  • 496
  • 2
  • 11
  • If I have two instances of the client ( my application) created using the replica feature of the pod. In this scenario I have only one url pointing to the Two clients. So I assume this may not work in a real scenario. – arunvg Dec 20 '19 at 12:44
  • But certainly, thank you for the input, looks like this could solve my problem in a single client scenario. – arunvg Dec 20 '19 at 12:45
  • 1
    Hi Arunvg, our application also have multiple replicas. This works fine for us. SBA doesn't know about the individual pods instead it registers the load-balanced url. Just, you should not enable the prefer-ip property. You could give it a try :) – Mohit Singh Dec 20 '19 at 13:07
  • Sure Let me try that out. Your confidence is giving me hope :) – arunvg Dec 20 '19 at 13:13
  • Yup it worked. I was looking to a totally different direction – arunvg Dec 21 '19 at 10:52
  • great, enjoy.. :) – Mohit Singh Dec 22 '19 at 20:52
  • Did this solution with service-base-url show two instances if it was still resolving without the ip? Or just once instance rebalanced? – Patryk Imosa Dec 27 '22 at 13:51