2

I have an environment with different services. They all are deployed and managed by Docker images and Kubernetes. I also use spring-boot-admin in order to monitor them all and spring-cloud-kubernetes to discover all the services automatically. This my properties file.

application.yml (In the SBA project)

server:
 port: ${admin-server.port:8086}
 tomcat:
remote-ip-header: x-forwarded-for
protocol-header: x-forwarded-proto
spring:
application:
name: admin-server
security:
user:
  name: ${spring-security.admin.username:****}
  password:  ${spring-security.admin.password:****}
boot:
admin:
  discovery:
    ignored-services: admin-server
  notify:
    mail:
      enabled: ${admin-mail.enabled:true}
      to: ${admin-mail.recipients:******}
      from: ${admin-mail.from:******}
      template: classpath:/template/status-changed.html
      ignore-changes: OFFLINE:UP, DOWN:UP
    slack:
      webhook-url: ${admin-slack.webhook:*******}
      ignore-changes: OFFLINE:UP, DOWN:UP
      enabled: true
 mail:
test-connection: false
host: smtpjc.*****
port: 25
properties:
  mail:
    smtp:
      connectiontimeout: 5000
      timeout: 3000
      writetimeout: 5000
    debug: ${admin-mail.debug:true}

It works perfectly whenever I restart the SBA project, it discovers every service. My problem comes when I restart a single project, it is shown as OFFLINE in the SBA and it does not change its status.

What am I missing?

NeoChiri
  • 296
  • 4
  • 18

2 Answers2

1

I have found the issue and fixed it like this:

spring.cloud.kubernetes.reload.enabled: true

I should have added this line to the config file.

NeoChiri
  • 296
  • 4
  • 18
0

I've found out, that I had to use the fabric8 kubernetes-client.

<dependency>
  <groupId>org.springframework.cloud</groupId>
  <artifactId>spring-cloud-starter-kubernetes-fabric8-all</artifactId>
</dependency>

I'm using these current versions:

<spring-cloud.version>2020.0.2</spring-cloud.version>
<spring-cloud-kubernetes.version>2.0.2</spring-cloud-kubernetes.version>
<spring-boot-admin.version>2.4.1</spring-boot-admin.version>

Otherwise I follow the instructions of https://piotrminkowski.com/2020/02/18/spring-boot-admin-on-kubernetes/

Matthias M
  • 12,906
  • 17
  • 87
  • 116