liveBook · Manning

Liveness check

As explained in Quarkus in Action

A Kubernetes liveness probe periodically determines whether a container should be restarted because its application is no longer recoverable.

A liveness check determines whether an application can continue running. Kubernetes periodically calls the health endpoint used by the liveness probe; a failed check indicates an unrecoverable problem, such as exhausted memory or a deadlock, so Kubernetes restarts the pod. section 10.2

In Quarkus, SmallRye Health implements MicroProfile Health and exposes health information over HTTP. The aggregate endpoint is /q/health, while /q/health/live returns only liveness checks. Readiness is different: it reports whether the application can accept traffic, and a failure causes Kubernetes to withhold traffic rather than restart the pod. section 10.2 section 10.2.1

Use the probe types for different operational decisions:

  • Liveness: restart the pod when the application is not expected to recover. section 10.2
  • Readiness: stop sending traffic while a dependency or operating condition prevents request processing. section 10.2
  • Startup: cover initialization until the application is ready, after which liveness and readiness take over. section 10.2

Expose the health endpoints

Add the SmallRye Health extension with `quarkus extension add smallrye-health`, run the application, and inspect `/q/health` or `/q/health/live`. Quarkus also provides a Dev UI Health UI for viewing checks during development. section 10.2.1

$ quarkus extension add smallrye-health

Install the Quarkus extension that supplies the SmallRye Health endpoints and health-check integration. section 10.2.1

How Quarkus in Action covers it

How deep it goes
Defines failure meaning and Kubernetes response, but does not detail probe timing configuration or custom liveness implementation.
Examples
Uses /q/health/live, the SmallRye Health extension, Dev UI, and aggregate JSON health output as concrete artifacts.
What you can do after
Operate health monitoring by adding SmallRye Health and querying aggregate or liveness-specific HTTP endpoints.
How it connects
Connects liveness checks with readiness checks, startup probes, MicroProfile Health, SmallRye Health, and Kubernetes pod restarts.

Also explained in

Compare how 7 books explain liveness check →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Quarkus in Action. The section links point to the parts of the book it draws on.