1. apiVersion: v1
    2. kind: Pod
    3. metadata:
    4. name: pod-health-check
    5. labels:
    6. name: pod-health-check
    7. namespace: default
    8. spec:
    9. containers:
    10. - name: busybox-health-check
    11. image: busybox
    12. command:
    13. - "/bin/sh"
    14. - "-c"
    15. - "touch /tmp/health; sleep 30; rm -f /tmp/health; sleep 600"
    16. livenessProbe:
    17. exec:
    18. command:
    19. - "/bin/sh"
    20. - "-c"
    21. - "cat /tmp/health"
    22. initialDelaySeconds: 5
    23. periodSeconds: 5

    HTTP

    1. livenessProbe:
    2. httpGet:
    3. path: /healthz
    4. port: 8080
    5. httpHeaders:
    6. - name: X-Custom-Header
    7. value: Awesome
    8. initialDelaySeconds: 3
    9. periodSeconds: 3

    TCP

    1. ...
    2. livenessProbe:
    3. tcpSocket:
    4. port: 8080
    5. initialDelaySeconds: 15
    6. periodSeconds: 20