【问题标题】:When is liveness probe retried in k8s?k8s什么时候重试liveness probe?
【发布时间】:2021-10-26 22:21:26
【问题描述】:

我正在尝试了解活性探测的重试行为,从documentation 不清楚。

我将举例说明。考虑以下活性探测规范

periodSeconds: 60
timeoutSeconds: 15
failureThreshold: 3

假设服务已关闭

预期会出现哪种行为?

the probe kicks off at 0s
sees a failure at 15s, (due to timeoutSeconds 15) 
retry1 at ~15s, fail at ~30s and retry2 at ~30s, fail at ~45 (retry immediately after failure)
ultimately restart pod at ~45s (due to failureThreshold 3)

the probe kicks off at 0s
sees a failure at 15s, (due to timeoutSeconds 15) 
retry1 at ~60s, fail at ~75s and retry2 at ~120s, fail at ~135s (due to periodSeconds 60, doesnt really do retry after a failure)
ultimately restart pod at ~180s (due to failureThreshold 3)

【问题讨论】:

    标签: kubernetes google-kubernetes-engine livenessprobe


    【解决方案1】:

    periodSeconds 是它检查的频率。如果你的意思是在超过失败阈值后重试,它永远不会因为容器从头开始完全重新启动。

    【讨论】:

    • 我指的是在超过失败阈值之前,如果k8s看到失败,是立即重试探测还是只是等待下一个periodSeconds
    • 等待下一个周期。
    猜你喜欢
    • 1970-01-01
    • 2019-04-02
    • 2022-01-07
    • 1970-01-01
    • 2020-04-11
    • 2018-05-31
    • 2016-06-12
    • 2021-05-23
    • 1970-01-01
    相关资源
    最近更新 更多