第 12 章 红帽在 Red Hat OpenShift Container Platform 上构建 Kogito 微服务的探测
Red Hat OpenShift Container Platform 中的探测验证应用程序是否正常工作或需要重启它。对于红帽构建的 Quarkus 和 Spring Boot 的 Kogito 微服务,探测使用 HTTP 请求与应用程序交互,默认为通过扩展公开的端点。因此,要在 Red Hat OpenShift Container Platform 上运行 Kogito 微服务的红帽构建,您必须导入扩展来为 存活度、就绪度和启动探测 提供应用程序可用性信息。
您可以为红帽构建的 Kogito 服务添加健康检查扩展,这些服务基于 Red Hat OpenShift Container Platform 上红帽构建的 Quarkus。
流程
在命令终端中,导航到项目的 pom.xml 文件,再为 quarkus-smallrye-health 扩展添加以下依赖项:
Red Hat OpenShift Container Platform 上构建的 Quarkus 应用程序小的健康状况依赖
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-health</artifactId>
</dependency>
</dependencies>