Kubernetes 健康检查 : timeoutSeconds exceeds periodSeconds

标签 kubernetes kubernetes-health-check readinessprobe livenessprobe

在 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里面有图这清楚地说明了你的问题:

Probe Timeline

pod 将在最低时重新启动,

time = initialDelay + (failureThreshold - 1) * period + timeout

  • timeoutSeconds > periodSeconds ?

探测调用将在给定的时间间隔内触发,与之前的探测响应无关。一旦探测调用通过或失败/超时,将检查 failureThreshold。但建议使用大于timeoutSecondsperiodSeconds

关于Kubernetes 健康检查 : timeoutSeconds exceeds periodSeconds,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66687912/

相关文章:

kubernetes - 即使端点正在工作,k8s 准备和活跃度探测也会失败

kubernetes - Kubernetes/GCE入口 Controller 失败

docker - 在 CoreOS 上运行 Kubernetes 示例,第 1 部分不起作用

kubernetes - Kubernetes-如何知道哪个奴才在托管Pod

kubernetes - GKE Ingress 上的 gRPC 和 HTTP 服务器未能对 gRPC 后端进行运行状况检查

kubernetes - Kubernetes:使用httpGet进行就绪检查

kubernetes - GKE resourcequota不正确地显示已达到 pods 限制并阻止创建新 pods

kubernetes - 如何在alertmanager配置文件中插入 secret

kubernetes - 是否可以通过 HTTP 或 TCP 对 Kubernetes API 服务器进行健康检查?

http - 在TCP探针和HTTP探针之间进行选择以提高kubernetes的 liveness 和就绪性