Skip to content

Commit c3cd5cf

Browse files
authored
Merge pull request #38947 from windsonsea/clrsp
[zh] sync configure-liveness-readiness-startup-probes.md
2 parents c7fb141 + 977da56 commit c3cd5cf

File tree

1 file changed

+39
-6
lines changed

1 file changed

+39
-6
lines changed

content/zh-cn/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes.md

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ title: 配置存活、就绪和启动探针
33
content_type: task
44
weight: 110
55
---
6+
<!--
7+
title: Configure Liveness, Readiness and Startup Probes
8+
content_type: task
9+
weight: 110
10+
-->
611

712
<!-- overview -->
813
<!--
@@ -608,19 +613,47 @@ to 1 second. Minimum value is 1.
608613
* `successThreshold`: Minimum consecutive successes for the probe to be
609614
considered successful after having failed. Defaults to 1. Must be 1 for liveness
610615
and startup Probes. Minimum value is 1.
611-
* `failureThreshold`: When a probe fails, Kubernetes will
612-
try `failureThreshold` times before giving up. Giving up in case of liveness probe means restarting the container. In case of readiness probe the Pod will be marked Unready.
613-
Defaults to 3. Minimum value is 1.
614616
-->
615617
* `initialDelaySeconds`:容器启动后要等待多少秒后才启动启动、存活和就绪探针,
616618
默认是 0 秒,最小值是 0。
617619
* `periodSeconds`:执行探测的时间间隔(单位是秒)。默认是 10 秒。最小值是 1。
618620
* `timeoutSeconds`:探测的超时后等待多少秒。默认值是 1 秒。最小值是 1。
619621
* `successThreshold`:探针在失败后,被视为成功的最小连续成功数。默认值是 1。
620622
存活和启动探测的这个值必须是 1。最小值是 1。
621-
* `failureThreshold`:当探测失败时,Kubernetes 的重试次数。
622-
对存活探测而言,放弃就意味着重新启动容器。
623-
对就绪探测而言,放弃意味着 Pod 会被打上未就绪的标签。默认值是 3。最小值是 1。
623+
<!--
624+
* `failureThreshold`: After a probe fails `failureThreshold` times in a row, Kubernetes
625+
considers that the overall check has failed: the container is _not_ ready / healthy /
626+
live.
627+
For the case of a startup or liveness probe, if at least `failureThreshold` probes have
628+
failed, Kubernetes treats the container as unhealthy and triggers a restart for that
629+
specific container. The kubelet takes the setting of `terminationGracePeriodSeconds`
630+
for that container into account.
631+
For a failed readiness probe, the kubelet continues running the container that failed
632+
checks, and also continues to run more probes; because the check failed, the kubelet
633+
sets the `Ready` [condition](/docs/concepts/workloads/pods/pod-lifecycle/#pod-conditions)
634+
on the Pod to `false`.
635+
-->
636+
* `failureThreshold`:探针连续失败了 `failureThreshold` 次之后,
637+
Kubernetes 认为总体上检查已失败:容器状态未就绪、不健康、不活跃。
638+
对于启动探针或存活探针而言,如果至少有 `failureThreshold` 个探针已失败,
639+
Kubernetes 会将容器视为不健康并为这个特定的容器触发重启操作。
640+
kubelet 会考虑该容器的 `terminationGracePeriodSeconds` 设置。
641+
对于失败的就绪探针,kubelet 继续运行检查失败的容器,并继续运行更多探针;
642+
因为检查失败,kubelet 将 Pod 的 `Ready`
643+
[状况](/zh-cn/docs/concepts/workloads/pods/pod-lifecycle/#pod-conditions)设置为 `false`。
644+
<!--
645+
* `terminationGracePeriodSeconds`: configure a grace period for the kubelet to wait
646+
between triggering a shut down of the failed container, and then forcing the
647+
container runtime to stop that container.
648+
The default is to inherit the Pod-level value for `terminationGracePeriodSeconds`
649+
(30 seconds if not specified), and the minimum value is 1.
650+
See [probe-level `terminationGracePeriodSeconds`](#probe-level-terminationgraceperiodseconds)
651+
for more detail.
652+
-->
653+
* `terminationGracePeriodSeconds`:为 kubelet
654+
配置从为失败的容器触发终止操作到强制容器运行时停止该容器之前等待的宽限时长。
655+
默认值是继承 Pod 级别的 `terminationGracePeriodSeconds` 值(如果不设置则为 30 秒),最小值为 1。
656+
更多细节请参见[探针级别 `terminationGracePeriodSeconds`](#probe-level-terminationgraceperiodseconds)。
624657

625658
{{< note >}}
626659
<!--

0 commit comments

Comments
 (0)