spring - Openshift/Kubernetes 活力探针 Spring actuator
问题描述
我已经实现了弹簧执行器健康端点并将其添加到 Livelines 探针中 - http-get http://:8080/actuator/health
当我描述 pod 时,我没有看到 #success 计数器正在增加
http-get http://:8080/actuator/health delay=60s timeout=20s period=10s #success=1 #failure=3
如何知道 liveliness 探针是否真的使用默认执行器的健康端点运行
解决方案
这里的成功值是successThreshold。它不是一个计数器字段
kubectl explain pod.spec.containers.livenessProbe.successThreshold
DESCRIPTION:
Minimum consecutive successes for the probe to be considered successful
after having failed. Defaults to 1. Must be 1 for liveness. Minimum value
is 1.
同样有一个失败阈值
kubectl explain pod.spec.containers.livenessProbe.failureThreshold
当一个 Pod 启动并且探测失败时,Kubernetes 会在放弃之前尝试 failureThreshold 次。在 liveness probe 的情况下放弃意味着重新启动容器。在就绪探测的情况下,Pod 将被标记为未就绪。默认为 3。最小值为 1。configure -probes
如何知道 liveliness 探针是否真的使用默认执行器的健康端点运行
检查你的 pod 的日志
kubectl logs -f $pod
或者查看 kubelet 的日志,它正在探测 pod
journalctl -f -u kubelet
推荐阅读
- powershell - 如何在 Powershell 中将拆分的输出保存为具有自定义标题的列
- python-3.x - OpenCV 4.4.0:qt.qpa.xcb:无法连接到远程 EC2 实例上的显示。如何解决这个问题?
- flask - 烧瓶 url_for 导致 escape_chars http_405
- c++ - QObject::~QObject: 定时器不能从另一个线程停止
- google-cloud-platform - Cloud Run 在 121 秒后崩溃
- javascript - 哈夫曼算法与 Node JS 中的流
- node.js - typescript .d.ts 文件无法被 typescript 识别,但 vsc
- mysql - 如何在另一个表中通过 ID 连接 SQL 中的表?
- vue.js - 如何从 vue 中的计算属性数组字段创建数组?
- c - 如何在 C 中制作队列的副本?