gajus / lightship

Abstracts readiness, liveness and startup checks and graceful shutdown of Node.js services running in Kubernetes.
Other
517 stars 33 forks source link

Suggestions: adding support for a startup probe #19

Closed tdeekens closed 4 years ago

tdeekens commented 4 years ago

This is partially a suggestion and a question.

Kubernetes defines the ability next to liveness and readiness probes to define a startup probe.

startupProbe: Indicates whether the application within the Container is started. All other probes are disabled if a startup probe is provided, until it succeeds. If the startup probe fails, the kubelet kills the Container, and the Container is subjected to its restart policy. If a Container does not provide a startup probe, the default state is Success.

In examples the startup probe is often pointed to the /ready endpoint. I am wondering if it would make sense to add another endpoint to register a startup probe with. This probe would for instance be used to manage long taking processes when starting up or validating credentials before polling for ready. Lightship could maybe help here with providing an API for it.

Generally, I am also curious what thoughts are towards this.

gajus commented 4 years ago

Just use /live endpoint.

What would be a use case for a new endpoint that is not met by /live?

tdeekens commented 4 years ago

Thanks for responding. That's also the conconlusion I came to. To either use /live or /ready. The only difference would be that I might want those checks to only run on start up and not subsequently in the probe interval.

gajus commented 4 years ago

The only difference would be that I might want those checks to only run on start up and not subsequently in the probe interval.

I couldn't think of a scenario where this would be true. Though, if a use case appears, I will happily add an additional endpoint.

gajus commented 4 years ago

:tada: This issue has been resolved in version 6.0.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket: