如何解决Kubernetes 健康检查:timeoutSeconds 超过 periodSeconds
在 Kubernetes Kubernetes Health Check Probes
中,如果 timeoutSeconds
超过 periodSeconds
会发生什么?例如:
initialDelaySeconds: 10
periodSeconds: 5
timeoutSeconds: 10
successThreshold: 1
failureThreshold: 3
Pod 什么时候会“失败”?
-
initialDelaySeconds
+ (periodSeconds
*failureThreshold
);或 -
initialDelaySeconds
+ (MAX
(periodSeconds
,timeoutSeconds
) *failureThreshold
);
同样的问题适用于 Pod 成功的情况。
解决方法
此 blog post 中有一张图表清楚地说明了您的问题:
pod 将在最低重启,
time = initialDelay + (failureThreshold - 1) * period + timeout
-
timeoutSeconds
>periodSeconds
?
探测调用将以给定的时间间隔触发,与之前的探测响应无关。一旦探测调用通过或失败/超时,将检查 failureThreshold
。但建议使用大于 periodSeconds
的 timeoutSeconds
。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。