When running a native-built Spring Boot application on Kubernetes the liveness and readiness probes are not active (they both return a 404).
How to reproduce:
- Go to start.spring.io and select Web, Actuator and GraalVM Native
- Build a native image of your application (
mvn spring-boot:build-image -Pnative)
- Launch the application in Kubernetes (or set the appropriate environment when running locally
docker run -it --rm -e KUBERNETES_SERVICE_HOST=localhost -e KUBERNETES_SERVICE_PORT=8080 -p 8080:8080 docker.io/library/demo:0.0.1-SNAPSHOT)
- Open
http://localhost:8080/actuator/health/liveness
Expected result - HTTP 200 with body {"status":"UP"}, actual result HTTP 404.