From 02cdce3d7d13cb3e8ccfab3f3f7b48d2f96dbebe Mon Sep 17 00:00:00 2001 From: Alex Robinson Date: Sat, 18 Jul 2015 18:43:15 -0700 Subject: [PATCH] Add markdown highlighting to liveness user guide. --- docs/user-guide/liveness/README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/user-guide/liveness/README.md b/docs/user-guide/liveness/README.md index 1298f27ee8f..b175078b8ff 100644 --- a/docs/user-guide/liveness/README.md +++ b/docs/user-guide/liveness/README.md @@ -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