Merge pull request #34586 from tengqm/zh-resync-configprobes

[zh-cn] Resync configure probes page
This commit is contained in:
Kubernetes Prow Robot 2022-06-26 23:16:58 -07:00 committed by GitHub
commit 3acfcd32b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 17 deletions

View File

@ -6,7 +6,7 @@ weight: 110
<!-- overview --> <!-- overview -->
<!-- <!--
This page shows how to configure liveness, readiness and startup probes for Containers. This page shows how to configure liveness, readiness and startup probes for containers.
The [kubelet](/docs/reference/command-line-tools-reference/kubelet/) uses liveness probes to know when to The [kubelet](/docs/reference/command-line-tools-reference/kubelet/) uses liveness probes to know when to
restart a container. For example, liveness probes could catch a deadlock, restart a container. For example, liveness probes could catch a deadlock,
@ -341,7 +341,6 @@ kubectl describe pod goproxy
{{< feature-state for_k8s_version="v1.24" state="beta" >}} {{< feature-state for_k8s_version="v1.24" state="beta" >}}
<!-- <!--
If your application implements [gRPC Health Checking Protocol](https://github.com/grpc/grpc/blob/master/doc/health-checking.md), If your application implements [gRPC Health Checking Protocol](https://github.com/grpc/grpc/blob/master/doc/health-checking.md),
kubelet can be configured to use it for application liveness checks. kubelet can be configured to use it for application liveness checks.
@ -351,7 +350,8 @@ in order to configure checks that rely on gRPC.
Here is an example manifest: Here is an example manifest:
--> -->
如果你的应用实现了 [gRPC 健康检查协议](https://github.com/grpc/grpc/blob/master/doc/health-checking.md) 如果你的应用实现了
[gRPC 健康检查协议](https://github.com/grpc/grpc/blob/master/doc/health-checking.md)
kubelet 可以配置为使用该协议来执行应用活跃性检查。 kubelet 可以配置为使用该协议来执行应用活跃性检查。
你必须启用 `GRPCContainerProbe` 你必须启用 `GRPCContainerProbe`
[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/) [特性门控](/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
- 内置探测器运行时针对的是 Pod 的 IP 地址,不像 `grpc-health-probe` - 内置探测器运行时针对的是 Pod 的 IP 地址,不像 `grpc-health-probe`
那样通常针对 `127.0.0.1` 执行探测; 那样通常针对 `127.0.0.1` 执行探测;
请一定配置你的 gRPC 端点使之监听于 Pod 的 IP 地址之上。 请一定配置你的 gRPC 端点使之监听于 Pod 的 IP 地址之上。
- 内置探测器不支持任何身份认证参数(例如 `tls`)。 - 内置探测器不支持任何身份认证参数(例如 `-tls`)。
- 对于内置的探测器而言,不存在错误代码。所有错误都被视作探测失败。 - 对于内置的探测器而言,不存在错误代码。所有错误都被视作探测失败。
- 如果 `ExecProbeTimeout` 特性门控被设置为 `false`,则 `grpc-health-probe` - 如果 `ExecProbeTimeout` 特性门控被设置为 `false`,则 `grpc-health-probe`
不会考虑 `timeoutSeconds` 设置状态(默认值为 1s 不会考虑 `timeoutSeconds` 设置状态(默认值为 1s
@ -431,13 +431,13 @@ When migrating from grpc-health-probe to built-in probes, remember the following
## Use a named port ## Use a named port
You can use a named You can use a named
[ContainerPort](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#containerport-v1-core) [`port`](/docs/reference/kubernetes-api/workload-resources/pod-v1/#ports)
for HTTP or TCP liveness checks: for HTTP or TCP liveness checks:
--> -->
## 使用命名端口 {#use-a-named-port} ## 使用命名端口 {#use-a-named-port}
对于 HTTP 或者 TCP 存活检测可以使用命名的 对于 HTTP 或者 TCP 存活检测可以使用命名的
[ContainerPort](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#containerport-v1-core)。 [`port`](/zh-cn/docs/reference/kubernetes-api/workload-resources/pod-v1/#ports)。
```yaml ```yaml
ports: ports:
@ -527,17 +527,17 @@ Services.
Kubernetes 提供了就绪探测器来发现并缓解这些情况。 Kubernetes 提供了就绪探测器来发现并缓解这些情况。
容器所在 Pod 上报还未就绪的信息,并且不接受通过 Kubernetes Service 的流量。 容器所在 Pod 上报还未就绪的信息,并且不接受通过 Kubernetes Service 的流量。
{{< note >}}
<!-- <!--
Readiness probes runs on the container during its whole lifecycle. Readiness probes runs on the container during its whole lifecycle.
--> -->
{{< note >}}
就绪探测器在容器的整个生命周期中保持运行状态。 就绪探测器在容器的整个生命周期中保持运行状态。
{{< /note >}} {{< /note >}}
{{< caution >}}
<!-- <!--
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. 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.
--> -->
{{< caution >}}
活跃探测器 **不等待** 就绪性探测器成功。 活跃探测器 **不等待** 就绪性探测器成功。
如果要在执行活跃探测器之前等待,应该使用 `initialDelaySeconds``startupProbe` 如果要在执行活跃探测器之前等待,应该使用 `initialDelaySeconds``startupProbe`
{{< /caution >}} {{< /caution >}}
@ -827,7 +827,7 @@ a Pod or pod template specifies it.
```yaml ```yaml
spec: spec:
terminationGracePeriodSeconds: 3600 # pod-level terminationGracePeriodSeconds: 3600 # Pod 级别设置
containers: containers:
- name: test - name: test
image: ... image: ...
@ -843,7 +843,7 @@ spec:
port: liveness-port port: liveness-port
failureThreshold: 1 failureThreshold: 1
periodSeconds: 60 periodSeconds: 60
# Override pod-level terminationGracePeriodSeconds # # 重载 Pod 级别的 terminationGracePeriodSeconds
terminationGracePeriodSeconds: 60 terminationGracePeriodSeconds: 60
``` ```
@ -858,20 +858,20 @@ It will be rejected by the API server.
<!-- <!--
* Learn more about * Learn more about
[Container Probes](/docs/concepts/workloads/pods/pod-lifecycle/#container-probes). [Container Probes](/docs/concepts/workloads/pods/pod-lifecycle/#container-probes).
--> -->
* 进一步了解[容器探针](/zh-cn/docs/concepts/workloads/pods/pod-lifecycle/#container-probes)。 * 进一步了解[容器探针](/zh-cn/docs/concepts/workloads/pods/pod-lifecycle/#container-probes)。
<!-- <!--
You can also read the API references for: You can also read the API references for:
* [Pod](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#pod-v1-core) * [Pod](/docs/reference/kubernetes-api/workload-resources/pod-v1/), and specifically:
* [Container](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#container-v1-core) * [container(s)](/docs/reference/kubernetes-api/workload-resources/pod-v1/#Container)
* [Probe](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#probe-v1-core) * [probe(s)](/docs/reference/kubernetes-api/workload-resources/pod-v1/#Probe)
--> -->
你也可以阅读以下的 API 参考资料: 你也可以阅读以下的 API 参考资料:
* [Pod](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#pod-v1-core) * [Pod](/zh-cn/docs/reference/kubernetes-api/workload-resources/pod-v1/),尤其是:
* [Container](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#container-v1-core) * [container](/zh-cn/docs/reference/kubernetes-api/workload-resources/pod-v1/#Container)
* [Probe](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#probe-v1-core) * [probe](/zh-cn/docs/reference/kubernetes-api/workload-resources/pod-v1/#Probe)