Scrivio Interview library
DesignIntermediate6 min read · updated 12 November 2026

A health endpoint includes checks for the database, Redis, Kafka and three downstream HTTP services. During a downstream outage Kubernetes restarts all pods. What is wrong with this design, and how would you use health groups?

Liveness included dependency checks, so a downstream outage made healthy pods look dead, and Kubernetes restarted them, which cannot fix a downstream outage and adds load at startup. With health groups, liveness checks only the application's own internal state, readiness includes only the dependencies needed to serve traffic, and downstream services with fallbacks affect neither. Groups are configured with management.endpoint.health.group.<name>.include.

Why this question is asked

Many outages get worse because of health checks rather than despite them. A single downstream service goes down, every pod that depends on it reports DOWN, and the orchestrator responds by restarting all of them at once, turning a partial outage into a full one. Interviewers ask this design question to see whether we understand what each probe is for and how to give each one only the checks it should act on. In this answer, we will recap liveness and readiness, walk through how the restart storm happens, design the groups, configure them, and decide what to do with each dependency.

1A Quick Recap of Liveness and Readiness

Kubernetes asks two different questions. The liveness probe asks: is this process broken in a way only a restart can fix, such as a deadlock or a corrupted internal state? If it fails repeatedly, Kubernetes kills and restarts the container. The readiness probe asks: should this pod receive traffic right now? If it fails, Kubernetes removes the pod from the Service endpoints but leaves it running, and adds it back when it passes again.

Spring Boot supports both through health groups, named subsets of health indicators each with its own URL. With probes enabled, which Boot does automatically when it detects Kubernetes, it provides /actuator/health/liveness and /actuator/health/readiness, based on the application's internal LivenessState and ReadinessState.

2How a Downstream Outage Became a Restart Storm

In the current design, both probes point at /actuator/health, which includes the database, Redis, Kafka and three downstream HTTP services. Suppose the recommendations service, one of the three, goes down. Every pod's health turns DOWN, the liveness probe fails three times, and Kubernetes restarts every pod.

The restart cannot help, because the problem is not in our pods. Worse, restarting pods do real work: they warm caches, open database connections and replay Kafka offsets, so the database and Kafka get a spike of load just when the system is already under stress. And while they restart, they serve nothing, so features that never needed the recommendations service go down too.

Step throughOne downstream failure, every pod restarted
kubeletOur podRecommendationsDatabase
GET /actuator/health (liveness)
health check call
timeout: service is down
503 DOWN
third failure: kill and restart
startup: new connections, cache warm-up
liveness still DOWN: restart again

7 messages in order. Play them, or step through them one at a time.

The restart cannot fix the downstream, and every restart adds load to the database.

3Designing the Groups

The rule is to give each probe only the checks it can act on. Liveness includes only the application's internal state. A restart fixes problems inside the process, so liveness must not depend on anything outside it. In Boot this is the livenessState indicator, which turns BROKEN if the application reports an unrecoverable internal error.

Readiness includes readinessState plus the dependencies the pod truly needs to serve traffic. If the orders service cannot do anything useful without its PostgreSQL database, db belongs in readiness. But notice the catch: if the database is down for every pod, readiness fails for every pod, and the Service has no endpoints, so callers get connection errors instead of a clear 503. For a shared dependency, that is sometimes still the right behaviour, and sometimes it is better to stay ready and fail requests quickly with a good error message. That is a deliberate choice per service.

Downstream services with fallbacks affect neither group. If the recommendations call has a fallback, such as showing popular items instead of personal ones, the pod can still serve traffic when recommendations is down. Removing it from rotation would turn a degraded feature into an outage.

Which checks go where
CheckLivenessReadinessReason
livenessStateYesNoInternal state only a restart can fix
readinessStateNoYesStartup, shutdown, app-reported state
db (PostgreSQL)NoYes, if requiredNo useful work without it
redis (cache)NoNoCache miss falls back to the database
kafkaNoDependsOnly if requests need it synchronously
Downstreams with fallbacksNoNoDegraded, still able to serve

4Configuring the Groups

Groups are configured with management.endpoint.health.group.<name>.include, listing the health component names. The liveness and readiness groups exist when probes are enabled, and we can redefine what they include. Other checks stay in the main /actuator/health or in a group of their own for dashboards.

Java
management.endpoint.health.probes.enabled=true # automatic on Kubernetes, explicit here
management.endpoint.health.group.liveness.include=livenessState
management.endpoint.health.group.readiness.include=readinessState,db
management.endpoint.health.group.dependencies.include=redis,kafka,pricing,recommendations,inventory
management.endpoint.health.group.dependencies.show-details=when-authorized
$ curl -s localhost:8080/actuator/health/liveness
{"status":"UP"} # recommendations down: no effect
$ curl -s localhost:8080/actuator/health/readiness
{"status":"UP"} # still serving, recommendations has a fallback
$ curl -s localhost:8080/actuator/health/dependencies
{"status":"DOWN", ...} # visible to dashboards and alerts, restarts nothing

Notice the third group. We do not throw the dependency checks away; we move them where they inform people instead of triggering automatic actions. An alert on the dependencies group tells the on-call engineer that recommendations is down, which is useful, while Kubernetes leaves our pods alone. The probes in the deployment point at /actuator/health/liveness and /actuator/health/readiness, never at the plain /actuator/health.

5Checking the Design Under Failure

A design like this should be proven, not assumed. In staging we stop each dependency in turn, under load, and watch what happens: with recommendations down, no pod restarts and pages show the fallback; with Redis down, no restarts and latency rises a little; with the database down, pods become not ready as we decided, and nothing restarts. We also check the probe timings, because a liveness probe with a 1 second timeout can fail on a busy pod during a long garbage collection pause, which would cause restarts for a different reason. A liveness probe should be generous, for example a timeout of a few seconds and several failures before a restart.

Step throughShould a check be in a probe group?
  1. Would restarting the pod fix it?
    YesLivenessNoNot liveness
  2. Can the pod serve useful traffic without it?
    YesNot readinessNoReadiness
  3. Everything elsea dependencies group for dashboards and alerts

3 steps in order. Play them, or step through them one at a time.

6Follow-up questions

Why not include the database in liveness, since the app cannot work without it?

Because a restart does not bring the database back. If the database is down, liveness failures restart every pod, each restart opens new connections and repeats startup work, and when the database recovers it faces a burst of reconnecting pods. Readiness, which only removes the pod from traffic, is the right place if anywhere.

What is the difference between DOWN and OUT_OF_SERVICE here?

Both map to HTTP 503 by default. OUT_OF_SERVICE is typically used for a pod that is deliberately not taking traffic, for example during shutdown, when Boot sets readiness to REFUSING_TRAFFIC, while DOWN means a check failed. For probes, the result is the same: the probe fails.

Can the probe endpoints be served on the main port when Actuator has its own port?

Yes. With management.endpoint.health.probes.add-additional-paths=true, Boot also serves the liveness and readiness groups at /livez and /readyz on the main server port, so the probes check the same server that handles user traffic.

7Conclusion

In this answer, we saw that putting dependency checks into liveness made a downstream outage look like broken pods, and restarts could not fix it while adding load at startup. With health groups, liveness includes only internal state, readiness includes only dependencies needed to serve traffic, downstreams with fallbacks affect neither, and the remaining checks move to a dependencies group for alerts. Groups are configured with management.endpoint.health.group.<name>.include and proven by stopping dependencies in staging.

What to say in the interviewAbout 80 seconds aloud

Open with

The problem is that liveness included dependency checks. Liveness answers one question, is this process broken in a way a restart fixes, but here a downstream outage made healthy pods look dead, so Kubernetes restarted all of them.

Then, if they want more

A restart cannot fix someone else's outage, and restarting pods add load at startup, new database connections, cache warm-up, so the outage spreads. I would split the checks with health groups. Liveness includes only internal state, the livenessState indicator.

Readiness includes readinessState plus only the dependencies the pod truly needs to serve traffic, for example the database if nothing works without it, and even that is a conscious choice, because if all pods go not ready the Service has no endpoints.

Downstream services with fallbacks, like a recommendations call that can show popular items, affect neither group, because the pod can still serve. Redis as a cache usually stays out too.

I configure this with management.endpoint.health.group.liveness.include and group.readiness.include, point the probes at /actuator/health/liveness and /readiness, and put the remaining checks in a dependencies group that feeds dashboards and alerts instead of restarts. Then I prove it in staging by stopping each dependency under load and checking that nothing restarts.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Official documentation
Spring Boot reference, Actuator
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "A health endpoint includes checks for the database, Redis, Kafka and three downstream...": https://scrivio-interview-library.netlify.app/spring-boot/actuator/92cc8e0b8f/