例如,假设我有一个荚,它执行GET请求它的活性探测,超时时间为5秒,时间为10秒。这些时间线中的哪一个代表探测器的时间?
自上一次探测模式:
0s: liveness probe initiated
5s: liveness probe times out
10s: liveness probe initiated again because 10 seconds have elapsed since the start of the last probe或自超时模式:
0s: liveness probe initiated
5s: liveness probe times out
15s: 10 seconds have elapsed since the timeout occurred, so the probe fires again在前者中,探针之间总是有10秒,而在后者中,根据请求返回的速度,探测之间可能有10到15秒的间隔。库伯奈特斯用哪种方法?
发布于 2020-10-07 11:58:45
Kubernetes livenessProbe的工作方式如下:
periodSeconds是从上一个探测被发送到。
因此,在您的示例(timeoutSeconds=5,periodSeconds=10)中,探测将如下所示:
0s: liveness probe initiated
5s: liveness probe times out
10s: liveness probe initiated again because 10 seconds have elapsed since the start of the last probe如果相反(timeoutSeconds=10,periodSeconds=5),则探针如下所示:
0s: liveness probe initiated
10s: liveness probe times out
10s: liveness probe initiated again发布于 2020-10-07 08:25:58
根据库伯奈特的文件-
-- kubelet在容器启动后开始执行'x‘秒(即句点)的健康检查。这意味着探测已经过去,一旦您从api调用本身获得成功响应,这个周期就会开始,这最终意味着容器已经启动(前提是针对探测中提到的端点的HTTP方法已经正确编写)。
对于故障情况,很明显,直到超时,它会等待响应来标记它的健康或不健康,然后它会尝试三倍于相同的东西,如果探测失败,它最终会重新启动容器。
https://stackoverflow.com/questions/64230250
复制相似问题