Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal Scheduled 41s default-scheduler Successfully assigned default/liveness-exec to node-1 Normal Pulling 40s kubelet Pulling image "registry.aliyuncs.com/google_containers/busybox" Normal Pulled 39s kubelet Successfully pulled image "registry.aliyuncs.com/google_containers/busybox"in 727.748993ms Normal Created 39s kubelet Created container liveness Normal Started 39s kubelet Started container liveness Warning Unhealthy 1s (x2 over 6s) kubelet Liveness probe failed: cat: can't open '/tmp/healthy': No such file or directory
检查看这个容器被重启了:
1 2 3
[root@master test]# kubectl get pod NAME READY STATUS RESTARTS AGE liveness-exec 1/1 Running 1 82s
Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal Scheduled 100s default-scheduler Successfully assigned default/liveness-http to node-1 Normal Pulled 84s kubelet Successfully pulled image "mirrorgooglecontainers/liveness" in 15.537483195s Normal Pulled 52s kubelet Successfully pulled image "mirrorgooglecontainers/liveness" in 15.375906607s Normal Pulled 19s kubelet Successfully pulled image "mirrorgooglecontainers/liveness" in 15.388654652s Normal Created 18s (x3 over 83s) kubelet Created container liveness Normal Started 18s (x3 over 83s) kubelet Started container liveness Warning Unhealthy 1s (x9 over 73s) kubelet Liveness probe failed: HTTP probe failed with statuscode: 500 Normal Killing 1s (x3 over 67s) kubelet Container liveness failed liveness probe, will be restarted Normal Pulling 1s (x4 over 99s) kubelet Pulling image "mirrorgooglecontainers/liveness"