apiVersion: v1
kind: Pod
metadata:
name: pod-health-check
labels:
name: pod-health-check
namespace: default
spec:
containers:
- name: busybox-health-check
image: busybox
command:
- "/bin/sh"
- "-c"
- "touch /tmp/health; sleep 30; rm -f /tmp/health; sleep 600"
livenessProbe:
exec:
command:
- "/bin/sh"
- "-c"
- "cat /tmp/health"
initialDelaySeconds: 5
periodSeconds: 5
HTTP
livenessProbe:
httpGet:
path: /healthz
port: 8080
httpHeaders:
- name: X-Custom-Header
value: Awesome
initialDelaySeconds: 3
periodSeconds: 3
TCP
...
livenessProbe:
tcpSocket:
port: 8080
initialDelaySeconds: 15
periodSeconds: 20