$ kubectl describe po/liveness-check | tail
node.kubernetes.io/unreachable:NoExecute for 300s
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 23s default-scheduler Successfully assigned default/liveness-check to minikube
Normal Pulling 23s kubelet, minikube pulling image "nginx"
Normal Pulled 19s kubelet, minikube Successfully pulled image "nginx"
Normal Created 19s kubelet, minikube Created container
Normal Started 19s kubelet, minikube Started container
Warning Unhealthy 1s kubelet, minikube Liveness probe failed: HTTP probe failed with statuscode: 403
しばらくするとコンテナが再作成される。
1
2
3
4
5
6
7
8
9
10
11
kubectl describe po/liveness-check | tail
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 1m default-scheduler Successfully assigned default/liveness-check to minikube
Normal Pulling 39s (x2 over 1m) kubelet, minikube pulling image "nginx"
Warning Unhealthy 39s (x5 over 59s) kubelet, minikube Liveness probe failed: HTTP probe failed with statuscode: 403
Normal Killing 39s kubelet, minikube Killing container with id docker://nginx:Container failed liveness probe.. Container will be killed and recreated.
Normal Pulled 36s (x2 over 1m) kubelet, minikube Successfully pulled image "nginx"
Normal Created 36s (x2 over 1m) kubelet, minikube Created container
Normal Started 36s (x2 over 1m) kubelet, minikube Started container
/ # wget -O - -T 1 readiness-check-svc
Connecting to readiness-check-svc (10.105.40.233:80)
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</body>
</html>
- 100% |**************************| 612 0:00:00 ETA
/ # exit
Session ended, resume using 'kubectl attach alpine-7bd47f56bc-kr789 -c alpi
ne-i -t' command when the pod is running
$ kubectl describe po/readiness-check | tail
node.kubernetes.io/unreachable:NoExecute for 300s
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 5m default-scheduler Successfully assigned default/readiness-check to minikube
Normal Pulling 5m kubelet, minikube pulling image "nginx"
Normal Pulled 5m kubelet, minikube Successfully pulled image "nginx"
Normal Created 5m kubelet, minikube Created container
Normal Started 5m kubelet, minikube Started container
Warning Unhealthy 23s (x23 over 45s) kubelet, minikube Readiness probe failed: HTTP probe failed with statuscode: 403
先程と同じようにServiceを経由してアクセスしてみよう。
1
2
3
4
5
6
7
8
$ kubectl run -it --rm alpine --image alpine -- ash
If you don't see a command prompt, try pressing enter.
/ # wget -O - -T 1 readiness-check-svc
Connecting to readiness-check-svc (10.105.40.233:80)
wget: download timed out
/ # exit
Session ended, resume using 'kubectl attach alpine-7bd47f56bc-j88tr -c alpi
ne -i -t' command when the pod is running
$ kubectl exec readiness-check -- sh -c 'echo ok > /usr/share/nginx/html/index.html'
少ししてから再度Serviceを経由したアクセスをしてみる。
1
2
3
4
5
6
$ kubectl run -it --rm alpine --image alpine -- ash
If you don't see a command prompt, try pressing enter.
/ # wget -O - -T 1 readiness-check-svc
Connecting to readiness-check-svc (10.105.40.233:80)
ok
- 100% |**************************| 3 0:00:00 ETA