21

Kubernetes' liveness and readiness probes for pods (deployment) can be configured with this initial delay ---- meaning the probe will start after this many seconds after the container is up. If it is not specified, what is the default value? I can't seem to find it. The default value for periodSeconds is documented as 10 second.

Thanks

4

3 回答 3

36

文档中似乎0缺少默认值。

运行状况或就绪检查算法的工作原理如下:

  1. 等待initialDelaySeconds
  2. 执行就绪检查并等待timeoutSeconds超时
  3. 如果持续成功的次数大于successThresholdreturnsuccess
    如果持续失败的次数大于failureThresholdreturnfailure
    否则等待periodSeconds并开始新的就绪检查
于 2018-02-02T08:12:35.957 回答
15

考虑到项目变化的速度,我想确保代码确实证实了这一点。

在公共 Kubernetes 存储库中找到了一个测试,该测试验证了探针的默认设置:

    expectedProbe := v1.Probe{
        InitialDelaySeconds: 0,
        TimeoutSeconds:      1,
        PeriodSeconds:       10,
        SuccessThreshold:    1,
        FailureThreshold:    3,
    }

TestSetDefaultProbe方法

https://github.com/kubernetes/kubernetes/blob/master/pkg/apis/core/v1/defaults_test.go

于 2019-06-19T09:23:30.267 回答
0

根据当前文档, initialDelaySeconds的默认值为0 。

供参考 -文档

在此处输入图像描述

于 2022-03-02T03:30:55.910 回答