Merge pull request #48639 from taguhoiya/update-doc-for-probes

Fix: improve clarity and formatting in liveness, readiness, and startup probes documentation
pull/48663/head
Kubernetes Prow Robot 2024-11-07 18:36:43 +00:00 committed by GitHub
commit b1aea65eaf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 8 deletions

View File

@ -16,22 +16,21 @@ Kubernetes has various types of probes:
## Liveness probe
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.
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.
If a container fails its liveness probe repeatedly, the kubelet restarts the container.
Liveness probes do not wait for readiness probes to succeed. If you want to wait before
executing a liveness probe you can either define `initialDelaySeconds`, or use a
Liveness probes do not wait for readiness probes to succeed. If you want to wait before executing a liveness probe, you can either define `initialDelaySeconds` or use a
[startup probe](#startup-probe).
## Readiness probe
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.
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.
If the readiness probe returns a failed state, Kubernetes removes the pod from all matching service endpoints.
Readiness probes runs on the container during its whole lifecycle.
Readiness probes run on the container during its whole lifecycle.
## Startup probe

View File

@ -495,9 +495,9 @@ startupProbe:
```
{{< note >}}
When the kubelet probes a Pod using HTTP, it only follows redirects if the redirect
When the kubelet probes a Pod using HTTP, it only follows redirects if the redirect
is to the same host. If the kubelet receives 11 or more redirects during probing, the probe is considered successful
and a related Event is created:
and a related Event is created:
```none
Events:
@ -508,7 +508,7 @@ Events:
Normal Pulled 24m kubelet Successfully pulled image "docker.io/kennethreitz/httpbin" in 5m12.402735213s
Normal Created 24m kubelet Created container httpbin
Normal Started 24m kubelet Started container httpbin
Warning ProbeWarning 4m11s (x1197 over 24m) kubelet Readiness probe warning: Probe terminated redirects
Warning ProbeWarning 4m11s (x1197 over 24m) kubelet Readiness probe warning: Probe terminated redirects
```
If the kubelet receives a redirect where the hostname is different from the request, the outcome of the probe is treated as successful and kubelet creates an event to report the redirect failure.