Kubernetes 健康检查:timeoutSeconds 超过 periodSeconds

h q*_*h q 8 kubernetes kubernetes-health-check readinessprobe livenessprobe

在 Kubernetes 中Kubernetes Health Check Probes,如果timeoutSeconds超过会发生什么periodSeconds?例如:

initialDelaySeconds: 10
periodSeconds: 5
timeoutSeconds: 10
successThreshold: 1
failureThreshold: 3
Run Code Online (Sandbox Code Playgroud)

Pod 什么时候会“失败”?

  • initialDelaySeconds+ ( periodSeconds* failureThreshold); 或者
  • initialDelaySeconds+ ( MAX( periodSeconds, timeoutSeconds) * failureThreshold);

当 Pod 成功时,同样的问题也适用。

Kam*_*san 9

这篇博文中有一个图表清楚地说明了您的问题:

调查时间表

Pod 将在最低时重新启动,

时间 = 初始延迟 + (failureThreshold - 1) * 周期 + 超时

  • timeoutSeconds> periodSeconds?

探测调用将以给定的时间间隔触发,与之前的探测响应无关。failureThreshold一旦探测调用通过或失败/超时,将对其进行检查。但建议使用periodSeconds大于timeoutSeconds.