3

Spring boot admin works fine if I run the spring boot app as an individual container under the same network.

How do I make it work for stack deployment or in swarm mode?

I tried creating a compose file with spring boot app and spring boot admin and changed the admin URL on app to localhost:8080(even tried with admin:8080, I know this will not work because the container name is no longer admin and compose creates a random name and container_name option is not supported in swarm mode), both admin and app started fine expect client is not registering with server. The problem will be the localhost:8080.

How do I fix this issue?

MLavoie
  • 9,671
  • 41
  • 36
  • 56
ari
  • 61
  • 6

2 Answers2

0

Try using spring.boot.admin.client.prefer-ip=true and the client will use the ip and not hostname in url. Also ensure clients can reach the server and vice versa.

joshiste
  • 2,638
  • 1
  • 14
  • 19
0

Setting prefer-ip to true does not work either. The internal IP can change with each deployment.

Marco
  • 177
  • 1
  • 2
  • 11