第 10 章 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 上的 Red Hat build of Quarkus 应用程序的影响较小
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-health</artifactId>
</dependency>
</dependencies>