spring-projects / spring-boot

Spring Boot
https://spring.io/projects/spring-boot
Apache License 2.0
73.77k stars 40.36k forks source link

Automatically activate health probes in Cloud Foundry environments #39804

Open vchrisb opened 4 months ago

vchrisb commented 4 months ago

Recent version of cloud foundry do support in addition to an application health check also readiness check, like kubernetes does: https://docs.cloudfoundry.org/devguide/deploy-apps/manifest-attributes.html#readiness-health-check-type

Currently the health probes, LivenessStateHealthIndicator and ReadinessStateHealthIndicator are only automatically enabled in Kubernetes environments: https://docs.spring.io/spring-boot/docs/current/reference/html/actuator.html#actuator.endpoints.kubernetes-probes

By manually configuring management.endpoint.health.probes.enabled=true one can activate these probes and its corresponding endpoints, /actuator/health/liveness and /actuator/health/readiness, for cloud foundry health checks.

The ask is, to not only activate the health probes automatically in kubernetes but also in cloud foundry environments.

scottfrederick commented 4 months ago

@vchrisb What versions of Cloud Foundry support application health and readiness checks? Should the health probes only be enabled automatically if the Cloud Foundry version is at a certain level?

vchrisb commented 4 months ago

It is supported from cf-deployment v32.2.0 or TAS 5.0.0

From a cloud foundry perspective it could be enabled always, though the readiness endpoint is only usable starting with the before mentioned version.