【发布时间】:2020-04-11 13:27:57
【问题描述】:
我正在运行基于 Eclipse Microprofile 的休息服务。我的服务提供健康检查。这种健康检查(提供大量信息)的结果如下所示:
http://localhost:9990/health
HTTP=OK
{
"status":"UP",
"checks":[
{"name":"imixs-workflow",
"status":"UP",
"data":
{
"engine.version":"5.1.11-SNAPSHOT",
"model.groups":30,
"model.versions":20
}
}
]
}
如果名为“imixs-workflow”的检查显示“状态”“UP”,则服务是健康的。
我已经尝试使用这样的 livenessprobe 进行配置:
livenessProbe:
exec:
command: ["sh", "-c", "curl -s http://localhost:9990/health| grep -q imixs-workflow"]
initialDelaySeconds: 60
但这不起作用。
我应该如何配置这样一个 livenessprobe 来获取 http 结果中特定 json 字段的状态?
【问题讨论】: