Skip to content

Link to the Kubernetes documentation when discussing startup probes #50007

@victorherraiz

Description

@victorherraiz

Even after the changes for #28432, the documentation does not offer a clear recommendation for dealing with projects with possible long start-up times.

Current text:

If an application takes longer to start than the configured liveness period, Kubernetes mentions the "startupProbe" as a possible solution. Generally speaking, the "startupProbe" is not necessarily needed here, as the "readinessProbe" fails until all startup tasks are done. This means your application will not receive traffic until it is ready. However, if your application takes a long time to start, consider using a "startupProbe" to make sure that Kubernetes won’t kill your application while it is in the process of starting. See the section that describes how probes behave during the application lifecycle.

According to K8S documentation, liveness probes start at the same time as readiness probes. And configuring initialDelaySeconds could delay the availability of the service. Even the same service could take an arbitrary time to start, depending on several factors, and starting the liveness probes could cause some restarts.

To avoid this problem, I normally configure the startup probe pointing to the readiness endpoint. And I think it could be nice to mention that in the documentation or create a specific endpoint for startup covering all the scenarios with a complete solution. I prefer the latter option.

The main purpose of this proposal is to make the container available as soon as possible and prevent unnecessary restarts.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions