Add markdown highlighting to liveness user guide.

This commit is contained in:
Alex Robinson 2015-07-18 18:43:15 -07:00
parent 0435f1c333
commit 02cdce3d7d

View File

@ -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.
```
```yaml
livenessProbe:
exec:
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,
```
```sh
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.
```
```yaml
livenessProbe:
httpGet:
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:
```
# kubectl create -f docs/user-guide/liveness/exec-liveness.yaml
# kubectl create -f docs/user-guide/liveness/http-liveness.yaml
```console
$ kubectl create -f docs/user-guide/liveness/exec-liveness.yaml
$ kubectl create -f docs/user-guide/liveness/http-liveness.yaml
```
Check the status of the pods once they are created:
```
# kubectl get pods
```console
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
[...]
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:
```
# kubectl get pods
```console
$ kubectl get pods
mwielgus@mwielgusd:~/test/k2/kubernetes/examples/liveness$ kubectl get pods
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.
```
# kubectl describe pods liveness-exec
```console
$ 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: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