Hello Experts,

Setup : -> We have server.port = 8080 and management.server.port=9000.
-> /actuator/health/liveness on port 9000 is configured as liveness probe in our K8S deployment

Spring boot version = 3.1.10

Problem: -> Sometimes, port 8080 stops working but 9000 still remains alive. So, /actuator/health/liveness endpoint doesn't show real application status and the dead pods also keep receiving the request.

Expectation: -> If port 8080 stops working, the health endpoint should also go down, indicated correct application status

Comment From: wilkinsona

This is covered in the documentation on Kubernetes Probes:

If your Actuator endpoints are deployed on a separate management context, the endpoints do not use the same web infrastructure (port, connection pools, framework components) as the main application. In this case, a probe check could be successful even if the main application does not work properly (for example, it cannot accept new connections). For this reason, it is a good idea to make the liveness and readiness health groups available on the main server port. This can be done by setting the following property:

management.endpoint.health.probes.add-additional-paths=true This would make the liveness group available at /livez and the readiness group available at /readyz on the main server port.