Health Checks
On both Cloud Foundry and Kubernetes, it is possible to provide two separate endpoints for liveness checks ("are you alive?") and readiness checks ("are you ready for more requests?"). A failure on the former leads to a restart, whereas a failure on the latter temporarily takes the app instance out of the request dispatching rotation until a subsequent readiness probe is successful.
Learn more about health checks on Cloud Foundry.
Learn more about health checks on Kubernetes.
For CAP Node.js, the runtime provides an out-of-the-box endpoint for liveness and readiness checks at /health. Requests that reach this public endpoint are answered with the status code 200 and the body { status: 'UP' }.
Learn more about availability checks in Node.js.
For CAP Java, cds add mta and cds add kyma add the necessary dependencies and configuration for the publicly available probe endpoints /actuator/health/liveness and /actuator/health/readiness.
Learn more about availability checks in Java.
Learn more about Spring Boot health checks.
For deployment to Kyma/ Kubernetes, @sap/cds-dk adds the necessary configurations to Helm charts.
Limited support for readiness checks on CF
Although supported by the Cloud Foundry core, readiness checks are not yet supported by the Cloud Foundtry CLI as well as the Cloud MTA Build Tool (MBT).
Adjust deployment descriptors for custom health checks
Adjust the values created by cds add in case you add different Spring Boot health check endpoints or use a fully custom server.js.