Add markdown highlighting to liveness user guide.
This commit is contained in:
parent
0435f1c333
commit
02cdce3d7d
@ -37,7 +37,7 @@ This example shows two types of pod [health checks](../production-pods.md#livene
|
|||||||
|
|
||||||
The [exec-liveness.yaml](exec-liveness.yaml) demonstrates the container execution check.
|
The [exec-liveness.yaml](exec-liveness.yaml) demonstrates the container execution check.
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
exec:
|
exec:
|
||||||
command:
|
command:
|
||||||
@ -51,7 +51,7 @@ Kubelet executes the command `cat /tmp/health` in the container and reports fail
|
|||||||
|
|
||||||
Note that the container removes the `/tmp/health` file after 10 seconds,
|
Note that the container removes the `/tmp/health` file after 10 seconds,
|
||||||
|
|
||||||
```
|
```sh
|
||||||
echo ok > /tmp/health; sleep 10; rm -rf /tmp/health; sleep 600
|
echo ok > /tmp/health; sleep 10; rm -rf /tmp/health; sleep 600
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ so when Kubelet executes the health check 15 seconds (defined by initialDelaySec
|
|||||||
|
|
||||||
The [http-liveness.yaml](http-liveness.yaml) demonstrates the HTTP check.
|
The [http-liveness.yaml](http-liveness.yaml) demonstrates the HTTP check.
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /healthz
|
path: /healthz
|
||||||
@ -77,15 +77,15 @@ This [guide](../walkthrough/k8s201.md#health-checking) has more information on h
|
|||||||
|
|
||||||
To show the health check is actually working, first create the pods:
|
To show the health check is actually working, first create the pods:
|
||||||
|
|
||||||
```
|
```console
|
||||||
# kubectl create -f docs/user-guide/liveness/exec-liveness.yaml
|
$ kubectl create -f docs/user-guide/liveness/exec-liveness.yaml
|
||||||
# kubectl create -f docs/user-guide/liveness/http-liveness.yaml
|
$ kubectl create -f docs/user-guide/liveness/http-liveness.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
Check the status of the pods once they are created:
|
Check the status of the pods once they are created:
|
||||||
|
|
||||||
```
|
```console
|
||||||
# kubectl get pods
|
$ kubectl get pods
|
||||||
NAME READY STATUS RESTARTS AGE
|
NAME READY STATUS RESTARTS AGE
|
||||||
[...]
|
[...]
|
||||||
liveness-exec 1/1 Running 0 13s
|
liveness-exec 1/1 Running 0 13s
|
||||||
@ -94,8 +94,8 @@ liveness-http 1/1 Running 0
|
|||||||
|
|
||||||
Check the status half a minute later, you will see the container restart count being incremented:
|
Check the status half a minute later, you will see the container restart count being incremented:
|
||||||
|
|
||||||
```
|
```console
|
||||||
# kubectl get pods
|
$ kubectl get pods
|
||||||
mwielgus@mwielgusd:~/test/k2/kubernetes/examples/liveness$ kubectl get pods
|
mwielgus@mwielgusd:~/test/k2/kubernetes/examples/liveness$ kubectl get pods
|
||||||
NAME READY STATUS RESTARTS AGE
|
NAME READY STATUS RESTARTS AGE
|
||||||
[...]
|
[...]
|
||||||
@ -105,8 +105,8 @@ liveness-http 1/1 Running 1
|
|||||||
|
|
||||||
At the bottom of the *kubectl describe* output there are messages indicating that the liveness probes have failed, and the containers have been killed and recreated.
|
At the bottom of the *kubectl describe* output there are messages indicating that the liveness probes have failed, and the containers have been killed and recreated.
|
||||||
|
|
||||||
```
|
```console
|
||||||
# kubectl describe pods liveness-exec
|
$ kubectl describe pods liveness-exec
|
||||||
[...]
|
[...]
|
||||||
Sat, 27 Jun 2015 13:43:03 +0200 Sat, 27 Jun 2015 13:44:34 +0200 4 {kubelet kubernetes-minion-6fbi} spec.containers{liveness} unhealthy Liveness probe failed: cat: can't open '/tmp/health': No such file or directory
|
Sat, 27 Jun 2015 13:43:03 +0200 Sat, 27 Jun 2015 13:44:34 +0200 4 {kubelet kubernetes-minion-6fbi} spec.containers{liveness} unhealthy Liveness probe failed: cat: can't open '/tmp/health': No such file or directory
|
||||||
Sat, 27 Jun 2015 13:44:44 +0200 Sat, 27 Jun 2015 13:44:44 +0200 1 {kubelet kubernetes-minion-6fbi} spec.containers{liveness} killing Killing with docker id 65b52d62c635
|
Sat, 27 Jun 2015 13:44:44 +0200 Sat, 27 Jun 2015 13:44:44 +0200 1 {kubelet kubernetes-minion-6fbi} spec.containers{liveness} killing Killing with docker id 65b52d62c635
|
||||||
|
Loading…
Reference in New Issue
Block a user