Chapter 12. Probes for Red Hat build of Kogito microservices on Red Hat OpenShift Container Platform
The probes in Red Hat OpenShift Container Platform verify that an application is working or it needs to be restarted. For Red Hat build of Kogito microservices on Red Hat build of Quarkus and Spring Boot, probes interact with the application using an HTTP request, defaulting to the endpoints that are exposed by an extension. Therefore, to run your Red Hat build of Kogito microservices on Red Hat OpenShift Container Platform, you must import the extensions to provide application availability information for the liveness, readiness, and startup probes.
12.1. Adding health check extension for Red Hat build of Quarkus applications on Red Hat OpenShift Container Platform Copy linkLink copied to clipboard!
You can add the health check extension for the Red Hat build of Kogito services that are based on Red Hat build of Quarkus on Red Hat OpenShift Container Platform.
Procedure
In a command terminal, navigate to the pom.xml file of your project and add the following dependency for the quarkus-smallrye-health extension:
SmallRye Health dependency for Red Hat build of Quarkus applications on Red Hat OpenShift Container Platform
12.2. Adding health check extension for Spring Boot applications on Red Hat OpenShift Container Platform Copy linkLink copied to clipboard!
You can add the health check extension for the Red Hat build of Kogito microservices that are based on Spring Boot on Red Hat OpenShift Container Platform.
Procedure
In a command terminal, navigate to the pom.xml file of your project and add the following Spring Boot actuator dependency:
Spring Boot actuator dependency for Spring Boot applications on Red Hat OpenShift Container Platform
12.3. Setting custom probes for Red Hat build of Kogito microservices on Red Hat OpenShift Container Platform Copy linkLink copied to clipboard!
You can also configure the custom endpoints for the liveness, readiness, and startup probes.
Procedure
-
Define the probes in the
KogitoRuntimeYAML file of your project, as shown in the following example:
Example Red Hat build of Kogito microservice custom resource with custom probe endpoints