|
| 1 | +--- |
| 2 | +title: Liveness, Readiness, and Startup Probes |
| 3 | +content_type: concept |
| 4 | +weight: 40 |
| 5 | +--- |
| 6 | + |
| 7 | +<!-- overview --> |
| 8 | + |
| 9 | +Kubernetes has various types of probes: |
| 10 | + |
| 11 | +- [Liveness probe](#liveness-probe) |
| 12 | +- [Readiness probe](#readiness-probe) |
| 13 | +- [Startup probe](#startup-probe) |
| 14 | + |
| 15 | +<!-- body --> |
| 16 | + |
| 17 | +## Liveness probe |
| 18 | + |
| 19 | +Liveness probes determine when to restart a container. For example, liveness probes could catch a deadlock, when an application is running, but unable to make progress. |
| 20 | + |
| 21 | +If a container fails its liveness probe repeatedly, the kubelet restarts the container. |
| 22 | + |
| 23 | +Liveness probes do not wait for readiness probes to succeed. If you want to wait before |
| 24 | +executing a liveness probe you can either define `initialDelaySeconds`, or use a |
| 25 | +[startup probe](#startup-probe). |
| 26 | + |
| 27 | + |
| 28 | +## Readiness probe |
| 29 | + |
| 30 | +Readiness probes determine when a container is ready to start accepting traffic. This is useful when waiting for an application to perform time-consuming initial tasks, such as establishing network connections, loading files, and warming caches. |
| 31 | + |
| 32 | +If the readiness probe returns a failed state, Kubernetes removes the pod from all matching service endpoints. |
| 33 | + |
| 34 | +Readiness probes runs on the container during its whole lifecycle. |
| 35 | + |
| 36 | + |
| 37 | +## Startup probe |
| 38 | + |
| 39 | +A startup probe verifies whether the application within a container is started. This can be used to adopt liveness checks on slow starting containers, avoiding them getting killed by the kubelet before they are up and running. |
| 40 | + |
| 41 | +If such a probe is configured, it disables liveness and readiness checks until it succeeds. |
| 42 | + |
| 43 | +This type of probe is only executed at startup, unlike readiness probes, which are run periodically. |
| 44 | + |
| 45 | +* Read more about the [Configure Liveness, Readiness and Startup Probes](/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes). |
0 commit comments