@@ -6,7 +6,7 @@ weight: 110
6
6
7
7
<!-- overview -->
8
8
<!--
9
- This page shows how to configure liveness, readiness and startup probes for Containers .
9
+ This page shows how to configure liveness, readiness and startup probes for containers .
10
10
11
11
The [kubelet](/docs/reference/command-line-tools-reference/kubelet/) uses liveness probes to know when to
12
12
restart a container. For example, liveness probes could catch a deadlock,
@@ -341,7 +341,6 @@ kubectl describe pod goproxy
341
341
342
342
{{< feature-state for_k8s_version="v1.24" state="beta" >}}
343
343
344
-
345
344
<!--
346
345
If your application implements [gRPC Health Checking Protocol](https://github.com/grpc/grpc/blob/master/doc/health-checking.md),
347
346
kubelet can be configured to use it for application liveness checks.
@@ -351,7 +350,8 @@ in order to configure checks that rely on gRPC.
351
350
352
351
Here is an example manifest:
353
352
-->
354
- 如果你的应用实现了 [ gRPC 健康检查协议] ( https://github.com/grpc/grpc/blob/master/doc/health-checking.md ) ,
353
+ 如果你的应用实现了
354
+ [ gRPC 健康检查协议] ( https://github.com/grpc/grpc/blob/master/doc/health-checking.md ) ,
355
355
kubelet 可以配置为使用该协议来执行应用活跃性检查。
356
356
你必须启用 ` GRPCContainerProbe `
357
357
[ 特性门控] ( /zh-cn/docs/reference/command-line-tools-reference/feature-gates/ )
@@ -421,7 +421,7 @@ When migrating from grpc-health-probe to built-in probes, remember the following
421
421
- 内置探测器运行时针对的是 Pod 的 IP 地址,不像 ` grpc-health-probe `
422
422
那样通常针对 ` 127.0.0.1 ` 执行探测;
423
423
请一定配置你的 gRPC 端点使之监听于 Pod 的 IP 地址之上。
424
- - 内置探测器不支持任何身份认证参数(例如 ` tls ` )。
424
+ - 内置探测器不支持任何身份认证参数(例如 ` - tls` )。
425
425
- 对于内置的探测器而言,不存在错误代码。所有错误都被视作探测失败。
426
426
- 如果 ` ExecProbeTimeout ` 特性门控被设置为 ` false ` ,则 ` grpc-health-probe `
427
427
不会考虑 ` timeoutSeconds ` 设置状态(默认值为 1s),
@@ -431,13 +431,13 @@ When migrating from grpc-health-probe to built-in probes, remember the following
431
431
## Use a named port
432
432
433
433
You can use a named
434
- [ContainerPort ](/docs/reference/generated/ kubernetes-api/{{< param "version" >}}/#containerport -v1-core )
434
+ [`port` ](/docs/reference/kubernetes-api/workload-resources/pod -v1/#ports )
435
435
for HTTP or TCP liveness checks:
436
436
-->
437
437
## 使用命名端口 {#use-a-named-port}
438
438
439
439
对于 HTTP 或者 TCP 存活检测可以使用命名的
440
- [ ContainerPort ] (/docs/reference/generated/ kubernetes-api/{{< param "version" >}}/#containerport -v1-core )。
440
+ [ ` port ` ] ( /zh-cn/ docs/reference/kubernetes-api/workload-resources/pod -v1/#ports ) 。
441
441
442
442
``` yaml
443
443
ports :
@@ -527,17 +527,17 @@ Services.
527
527
Kubernetes 提供了就绪探测器来发现并缓解这些情况。
528
528
容器所在 Pod 上报还未就绪的信息,并且不接受通过 Kubernetes Service 的流量。
529
529
530
+ {{< note >}}
530
531
<!--
531
532
Readiness probes runs on the container during its whole lifecycle.
532
533
-->
533
- {{< note >}}
534
534
就绪探测器在容器的整个生命周期中保持运行状态。
535
535
{{< /note >}}
536
536
537
+ {{< caution >}}
537
538
<!--
538
539
Liveness probes *do not* wait for readiness probes to succeed. If you want to wait before executing a liveness probe you should use initialDelaySeconds or a startupProbe.
539
540
-->
540
- {{< caution >}}
541
541
活跃探测器 **不等待** 就绪性探测器成功。
542
542
如果要在执行活跃探测器之前等待,应该使用 `initialDelaySeconds` 或 `startupProbe`。
543
543
{{< /caution >}}
@@ -827,7 +827,7 @@ a Pod or pod template specifies it.
827
827
828
828
` ` ` yaml
829
829
spec:
830
- terminationGracePeriodSeconds: 3600 # pod-level
830
+ terminationGracePeriodSeconds: 3600 # Pod 级别设置
831
831
containers:
832
832
- name: test
833
833
image: ...
@@ -843,7 +843,7 @@ spec:
843
843
port: liveness-port
844
844
failureThreshold: 1
845
845
periodSeconds: 60
846
- # Override pod-level terminationGracePeriodSeconds #
846
+ # 重载 Pod 级别的 terminationGracePeriodSeconds
847
847
terminationGracePeriodSeconds: 60
848
848
` ` `
849
849
@@ -858,20 +858,20 @@ It will be rejected by the API server.
858
858
859
859
<!--
860
860
* Learn more about
861
- [Container Probes](/docs/concepts/workloads/pods/pod-lifecycle/#container-probes).
861
+ [Container Probes](/docs/concepts/workloads/pods/pod-lifecycle/#container-probes).
862
862
-->
863
863
* 进一步了解[容器探针](/zh-cn/docs/concepts/workloads/pods/pod-lifecycle/#container-probes)。
864
864
865
865
<!--
866
866
You can also read the API references for :
867
867
868
- * [Pod](/docs/reference/generated/ kubernetes-api/{{< param "version" >}}/# pod-v1-core)
869
- * [Container ](/docs/reference/generated/ kubernetes-api/{{< param "version" >}}/#container -v1-core )
870
- * [Probe ](/docs/reference/generated/ kubernetes-api/{{< param "version" >}}/#probe -v1-core )
868
+ * [Pod](/docs/reference/kubernetes-api/workload-resources/ pod-v1/), and specifically:
869
+ * [container(s) ](/docs/reference/kubernetes-api/workload-resources/pod -v1/#Container )
870
+ * [probe(s) ](/docs/reference/kubernetes-api/workload-resources/pod -v1/#Probe )
871
871
-->
872
872
你也可以阅读以下的 API 参考资料:
873
873
874
- * [Pod](/docs/reference/generated/ kubernetes-api/{{< param "version" >}}/# pod-v1-core)
875
- * [Container ](/docs/reference/generated/ kubernetes-api/{{< param "version" >}}/#container -v1-core )
876
- * [Probe ](/docs/reference/generated/ kubernetes-api/{{< param "version" >}}/#probe -v1-core )
874
+ * [Pod](/zh-cn/ docs/reference/kubernetes-api/workload-resources/ pod-v1/),尤其是:
875
+ * [container ](/zh-cn/ docs/reference/kubernetes-api/workload-resources/pod -v1/#Container )
876
+ * [probe ](/zh-cn/ docs/reference/kubernetes-api/workload-resources/pod -v1/#Probe )
877
877
0 commit comments