Skip to content

Commit

Permalink
Merge pull request #48639 from taguhoiya/update-doc-for-probes
Browse files Browse the repository at this point in the history
Fix: improve clarity and formatting in liveness, readiness, and startup probes documentation
  • Loading branch information
k8s-ci-robot authored Nov 7, 2024
2 parents 53ceaeb + 9a31b74 commit b1aea65
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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.
Expand Down

0 comments on commit b1aea65

Please sign in to comment.