Quick revision
The short answer
/actuator/health aggregates every health indicator, including the database, so when the database went down the endpoint returned 503 DOWN. Because the liveness probe pointed there, Kubernetes concluded every pod was broken and restarted them all, repeatedly, even though the pods themselves were fine and restarting could not fix the database. Liveness should use /actuator/health/liveness, which reflects only the application's own state, and external dependencies belong in readiness only when taking the pod out of traffic actually helps.
What to remember
In this answer, we saw that /actuator/health aggregates every indicator, including the database, so a database outage made the liveness probe fail and Kubernetes restarted healthy pods in a loop, which slowed recovery. Liveness should only reflect whether the process can recover by itself, so it belongs on /actuator/health/liveness. External dependencies belong in readiness only if taking the pod out of traffic helps, and the management.endpoint.health.group.readiness.include property controls exactly which indicators readiness uses.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
/actuator/health aggregates every health indicator, including the database, so when the database went down the endpoint returned 503 DOWN. Because the liveness probe pointed there, Kubernetes concluded every pod was broken and restarted them all, repeatedly, even though the pods themselves were fine and restarting could not fix the database. Liveness should use /actuator/health/liveness, which reflects only the application's own state, and external dependencies belong in readiness only when taking the pod out of traffic actually helps.
Why this question is asked
A restart storm during an outage turns a dependency problem into a full service outage, and it lasts longer than the original failure because every pod has to start again and warm up. It is one of the most common probe mistakes in Spring Boot services, and interviewers ask about it because the fix requires understanding what each probe is for, not just changing a path. In this answer, we will see what /actuator/health checks, follow the outage step by step, explain the rule for liveness, decide what readiness should include, and configure the health groups.
1What /actuator/health Actually Checks
Spring Boot Actuator collects health from health indicators, small beans that each check one thing. Auto-configuration adds them for what the application uses: DataSourceHealthIndicator runs a validation query against the database, and there are indicators for Redis, Kafka, RabbitMQ, disk space, and more. /actuator/health combines all of them with a status aggregator. If any indicator is DOWN, the overall status is DOWN, and the endpoint returns HTTP 503.
Notice the difference. The overall health is DOWN because of the database, while the liveness group, which by default contains only the liveness state, is UP. The process is healthy; one of its dependencies is not.
2Following the Outage Step by Step
The database became unreachable. Within seconds, every pod's /actuator/health returned 503. The liveness probe failed three times in a row, so the kubelet killed and restarted every container. The new containers started, but the database was still down, so their health endpoints also returned 503, and after the startup period the liveness probes failed again. Pods cycled through restarts, and Kubernetes added growing back-off delays between them, showing CrashLoopBackOff.
When the database came back, most pods were in the middle of a restart or waiting in back-off. Instead of serving immediately, the service needed several minutes for pods to start, warm their JIT and caches, and pass readiness. Requests that could have been answered from caches, or with a degraded response, failed during the whole outage. The restarts also caused a thundering herd of new connections to the database the moment it recovered.
7 messages in order. Play them, or step through them one at a time.
Restarting could never fix the database; it only lengthened the outage.
3The Rule for Liveness
A liveness probe should fail only when the process is in a state it cannot recover from by itself, and a restart would fix it: a deadlock, a corrupted internal state, an exhausted resource that never comes back. A database outage is the opposite: the process is fine, and it will recover by itself as soon as the database returns, since the connection pool reconnects.
So liveness must not include external dependencies at all. Spring Boot's /actuator/health/liveness group follows this rule by default: it contains only the LivenessState, which the application sets to BROKEN only when it decides it is broken. Changing the probe path is the main fix.
4What Readiness Should Include
Readiness is about traffic: should this pod receive requests? It is tempting to add the database to readiness instead, and sometimes that is right, but think about what happens. If every pod depends on the same database and it goes down, every pod becomes not ready, the Service has no endpoints, and clients get connection errors from the load balancer instead of a clear error or a cached answer from our application. Nothing was gained.
Including a dependency in readiness helps only when removing this pod lets traffic go somewhere better: for example, when each pod has its own local dependency, such as a sidecar or a per-node cache that can fail independently, or when the pod cannot serve any request at all without it and another pool can. For a shared database, usually keep it out of readiness too, and let the application return fast, clear errors or degraded responses, with circuit breakers to avoid piling up threads waiting for timeouts.
5Controlling the Health Groups
Spring Boot lets us decide exactly which indicators each group includes with the management.endpoint.health.group.<name>.include property. The defaults for liveness and readiness contain only the availability states, which is what we want for most services. If a dependency does belong in readiness, we add it explicitly, so the choice is visible in configuration.
The overall /actuator/health endpoint stays useful for dashboards and alerting: it tells operators the database is down. It just must not drive restarts.
6Follow-up questions
Should a pod ever report liveness BROKEN on its own?
Yes, when the application detects a state it cannot leave, for example a critical background thread has died or an internal deadlock detector fires. It can publish AvailabilityChangeEvent with LivenessState.BROKEN so the next probe fails and Kubernetes restarts it. That is the kind of failure liveness is for.
How do we stop all pods from flooding the database when it returns?
Connection pools with bounded sizes, connection timeouts and backoff, and circuit breakers that let traffic back gradually all help. Avoiding the restart storm already removes the biggest spike, since pods that stayed up reconnect through their pools instead of all starting at the same time.
How would we catch this mistake before an outage?
Review probe paths in the platform templates and run a game day: block the database from a staging environment and watch what the pods do. If they restart, the probes are wrong. A linter in the deployment pipeline that rejects liveness probes on /actuator/health also prevents the mistake.
7Conclusion
In this answer, we saw that /actuator/health aggregates every indicator, including the database, so a database outage made the liveness probe fail and Kubernetes restarted healthy pods in a loop, which slowed recovery. Liveness should only reflect whether the process can recover by itself, so it belongs on /actuator/health/liveness. External dependencies belong in readiness only if taking the pod out of traffic helps, and the management.endpoint.health.group.readiness.include property controls exactly which indicators readiness uses.
Open with
The problem is that /actuator/health is the aggregate of all health indicators, and Spring Boot adds one for the database automatically. When the database went down, that endpoint returned 503 DOWN.
Then, if they want more
Since liveness pointed at it, Kubernetes concluded every pod was broken and restarted them, but a restart cannot fix a database, so the new pods failed again and went into CrashLoopBackOff. When the database came back, most pods were restarting or in back-off, so recovery took minutes and they all reconnected at once.
The rule is that liveness should only fail when the process cannot recover by itself and a restart would help, like a deadlock. A dependency outage is the opposite. So I would point liveness at /actuator/health/liveness, which by default only contains the liveness state, and readiness at /actuator/health/readiness.
Then I would think carefully before adding the database to readiness: if every pod shares it, all pods go unready together and clients get nothing, so it only helps when removing this pod sends traffic somewhere better. I control that with management.endpoint.health.group.readiness.include.
I keep the full health endpoint for dashboards and alerts, and add a pipeline check and a game day to catch this mistake early.
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
- Kubernetes documentation
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 "During a database outage, all pods of a Spring Boot service were restarted repeatedly by...": https://scrivio-interview-library.netlify.app/spring-boot/containers-and-kubernetes/336ce20c3a/