Skip to content

Commit

Permalink
Create liveness-probe.md
Browse files Browse the repository at this point in the history
  • Loading branch information
javahometech authored Jun 24, 2019
1 parent 6f566a7 commit f63b8fd
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions liveness-probe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## Liveness and Readyness Probes

The kubelet uses liveness probes to know when to restart a Container. For example, liveness probes could catch a deadlock, where an application is running, but unable to make progress. Restarting a Container in such a state can help to make the application more available despite bugs.

```
apiVersion: v1
kind: Pod
metadata:
labels:
test: liveness
name: liveness-exec
spec:
containers:
- name: liveness
image: k8s.gcr.io/busybox
args:
- /bin/sh
- -c
- touch /tmp/healthy; sleep 30; rm -rf /tmp/healthy; sleep 600
livenessProbe:
exec:
command:
- cat
- /tmp/healthy
initialDelaySeconds: 5
periodSeconds: 5
```

kubectl create -f liveness-probe.yml

0 comments on commit f63b8fd

Please sign in to comment.