@@ -102,14 +102,14 @@ broken states, and cannot recover except by being restarted. Kubernetes provides
102
102
liveness probes to detect and remedy such situations.
103
103
104
104
In this exercise, you create a Pod that runs a container based on the
105
- `registry.k8s.io/busybox` image. Here is the configuration file for the Pod:
105
+ `registry.k8s.io/busybox:1.27.2 ` image. Here is the configuration file for the Pod:
106
106
-->
107
107
## 定义存活命令 {#define-a-liveness-command}
108
108
109
109
许多长时间运行的应用最终会进入损坏状态,除非重新启动,否则无法被恢复。
110
110
Kubernetes 提供了存活探针来发现并处理这种情况。
111
111
112
- 在本练习中,你会创建一个 Pod,其中运行一个基于 ` registry.k8s.io/busybox ` 镜像的容器。
112
+ 在本练习中,你会创建一个 Pod,其中运行一个基于 ` registry.k8s.io/busybox:1.27.2 ` 镜像的容器。
113
113
下面是这个 Pod 的配置文件。
114
114
115
115
{{% code_sample file="pods/probe/exec-liveness.yaml" %}}
@@ -174,8 +174,8 @@ The output indicates that no liveness probes have failed yet:
174
174
Type Reason Age From Message
175
175
---- ------ ---- ---- -------
176
176
Normal Scheduled 11s default-scheduler Successfully assigned default/liveness-exec to node01
177
- Normal Pulling 9s kubelet, node01 Pulling image "registry.k8s.io/busybox"
178
- Normal Pulled 7s kubelet, node01 Successfully pulled image "registry.k8s.io/busybox"
177
+ Normal Pulling 9s kubelet, node01 Pulling image "registry.k8s.io/busybox:1.27.2 "
178
+ Normal Pulled 7s kubelet, node01 Successfully pulled image "registry.k8s.io/busybox:1.27.2 "
179
179
Normal Created 7s kubelet, node01 Created container liveness
180
180
Normal Started 7s kubelet, node01 Started container liveness
181
181
```
@@ -199,8 +199,8 @@ probes have failed, and the failed containers have been killed and recreated.
199
199
Type Reason Age From Message
200
200
---- ------ ---- ---- -------
201
201
Normal Scheduled 57s default-scheduler Successfully assigned default/liveness-exec to node01
202
- Normal Pulling 55s kubelet, node01 Pulling image "registry.k8s.io/busybox"
203
- Normal Pulled 53s kubelet, node01 Successfully pulled image "registry.k8s.io/busybox"
202
+ Normal Pulling 55s kubelet, node01 Pulling image "registry.k8s.io/busybox:1.27.2 "
203
+ Normal Pulled 53s kubelet, node01 Successfully pulled image "registry.k8s.io/busybox:1.27.2 "
204
204
Normal Created 53s kubelet, node01 Created container liveness
205
205
Normal Started 53s kubelet, node01 Started container liveness
206
206
Warning Unhealthy 10s (x3 over 20s) kubelet, node01 Liveness probe failed: cat: can't open '/tmp/healthy': No such file or directory
0 commit comments