forked from javahometech/kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
javahometech
authored
Jun 24, 2019
1 parent
6f566a7
commit f63b8fd
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |