TECHIES WORLD

For Techs.... Techniques.... Technologies....

AWSBashLinux

How to enable Liveness and Readiness probes in a Spring Boot application

Kubernates deployments required liveness probes and readiness probes to confirm the application is up and running fine.

But from the version 2.3.2 of Spring Boot, this probes are disabled bydefault.

This article explains the method to enable liveness probes and readiness probes in Spring Boot applications.

Open the application.properties file and append the following lines.

management.endpoint.health.probes.enabled=true
management.health.livenessState.enabled=true
management.health.readinessState.enabled=true

Then rebuild the application and run.

Livenes URL will be,

http://APPLICATION-URL/actuator/health/liveness

Readiness URL will be,

http://APPLICATION-URL/actuator/health/readiness

That's all…