You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After 10 seconds, view Pod events to verify that liveness probes have failed and
262
-
the Container has been restarted:
262
+
the container has been restarted:
263
263
-->
264
264
10 秒之后,通过看 Pod 事件来检测存活探测器已经失败了并且容器被重新启动了。
265
265
@@ -269,7 +269,7 @@ kubectl describe pod liveness-http
269
269
270
270
<!--
271
271
In releases prior to v1.13 (including v1.13), if the environment variable
272
-
`http_proxy` (or `HTTP_PROXY`) is set on the node where a pod is running,
272
+
`http_proxy` (or `HTTP_PROXY`) is set on the node where a Pod is running,
273
273
the HTTP liveness probe uses that proxy.
274
274
In releases after v1.13, local HTTP proxy environment variable settings do not
275
275
affect the HTTP liveness probe.
@@ -281,7 +281,7 @@ affect the HTTP liveness probe.
281
281
<!--
282
282
## Define a TCP liveness probe
283
283
284
-
A third type of liveness probe uses a TCP Socket. With this configuration, the
284
+
A third type of liveness probe uses a TCP socket. With this configuration, the
285
285
kubelet will attempt to open a socket to your container on the specified port.
286
286
If it can establish a connection, the container is considered healthy, if it
287
287
can't it is considered a failure.
@@ -298,13 +298,13 @@ can't it is considered a failure.
298
298
As you can see, configuration for a TCP check is quite similar to an HTTP check.
299
299
This example uses both readiness and liveness probes. The kubelet will send the
300
300
first readiness probe 5 seconds after the container starts. This will attempt to
301
-
connect to the `goproxy` container on port 8080. If the probe succeeds, the pod
301
+
connect to the `goproxy` container on port 8080. If the probe succeeds, the Pod
302
302
will be marked as ready. The kubelet will continue to run this check every 10
303
303
seconds.
304
304
305
305
In addition to the readiness probe, this configuration includes a liveness probe.
306
306
The kubelet will run the first liveness probe 15 seconds after the container
307
-
starts. Just like the readiness probe, this will attempt to connect to the
307
+
starts. Similar to the readiness probe, this will attempt to connect to the
308
308
`goproxy` container on port 8080. If the liveness probe fails, the container
309
309
will be restarted.
310
310
@@ -317,7 +317,7 @@ To try the TCP liveness check, create a Pod:
317
317
318
318
除了就绪探测,这个配置包括了一个存活探测。
319
319
kubelet 会在容器启动 15 秒后进行第一次存活探测。
320
-
就像就绪探测一样,会尝试连接 `goproxy` 容器的 8080 端口。
320
+
与就绪探测类似,会尝试连接 `goproxy` 容器的 8080 端口。
321
321
如果存活探测失败,这个容器会被重新启动。
322
322
323
323
```shell
@@ -439,6 +439,14 @@ Readiness probes runs on the container during its whole lifecycle.
439
439
就绪探测器在容器的整个生命周期中保持运行状态。
440
440
{{< /note >}}
441
441
442
+
<!--
443
+
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.
Readiness probes are configured similarly to liveness probes. The only difference
444
452
is that you use the `readinessProbe` field instead of the `livenessProbe` field.
@@ -496,8 +504,8 @@ seconds. Minimum value is 1.
496
504
* `timeoutSeconds`: Number of seconds after which the probe times out. Defaults
497
505
to 1 second. Minimum value is 1.
498
506
* `successThreshold`: Minimum consecutive successes for the probe to be
499
-
considered successful after having failed. Defaults to 1. Must be 1 for
500
-
liveness and startup Probes. Minimum value is 1.
507
+
considered successful after having failed. Defaults to 1. Must be 1 for liveness
508
+
and startup Probes. Minimum value is 1.
501
509
* `failureThreshold`: When a probe fails, Kubernetes will
502
510
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.
503
511
Defaults to 3. Minimum value is 1.
@@ -511,6 +519,7 @@ Defaults to 3. Minimum value is 1.
511
519
存活探测情况下的放弃就意味着重新启动容器。
512
520
就绪探测情况下的放弃 Pod 会被打上未就绪的标签。默认值是 3。最小值是 1。
513
521
522
+
{{< note >}}
514
523
<!--
515
524
Before Kubernetes 1.20, the field `timeoutSeconds` was not respected for exec probes:
516
525
probes continued running indefinitely, even past their configured deadline,
@@ -545,7 +554,7 @@ the process inside the container may keep running even after probe returned fail
0 commit comments