Spring Boot Actuator, Kubernetes Probes, and What Your Users Actually See

A customer reaches checkout and asks for delivery options. The shop returns 503. At the same time, the same application returns 200 to its liveness check. Here are the two responses from the lab during one simulated outage, with headers omitted.

GET /actuator/health/liveness
HTTP/1.1 200
{"status":"UP"}

GET /api/shipping-options
HTTP/1.1 503
{"error":"shipping_unavailable"}

The shop is fictitious. Its shipping partner is returning errors, and customers cannot get a quote. The catalog still serves requests. The earlier RestTemplate-to-RestClient migration guide follows the same kind of shipping integration from the caller's side. Here the question is what an operator can do with each signal.

A desktop monitor shows Liveness UP while a phone displays Shipping options unavailable.
The operator sees a live process. The customer still needs a shipping option.

Two captured lab responses show HTTP 200 UP for liveness and HTTP 503 shipping_unavailable for the quote. Restarting cannot fix the partner. The catalog can still take traffic, and the shipping quote fails.

Would a restart help? A fresh shop process would call the same unavailable partner. Can the instance still take traffic? In the lab, the catalog still returns 200. Did the user get a result? The customer still has no delivery quote.

What Kubernetes does with a probe

A Kubernetes Pod contains one or more containers. The kubelet, the agent on the node hosting the Pod, runs the configured probes. For an HTTP probe, it requests a path on the Pod at the configured port. Responses from 200 through 399 count as success. A 503, a connection failure or a timeout counts as failure. Kubernetes uses the HTTP result and probe timing rather than interpreting Spring's JSON. Each probe has its own consequence. Kubernetes probe concepts · HTTP probe configuration

ProbeWhat it checksWhen failures reach the threshold
StartupHas the container reached its startup milestone?The kubelet stops the container and applies its restart policy. Liveness and readiness wait for startup success. After success, the startup probe stops for that run.
LivenessCan this instance recover by restarting?The kubelet stops the affected container. A Deployment restarts it, with backoff if the failures repeat.
ReadinessCan the Pod take ordinary Service traffic?The Pod becomes unready. The container keeps running. It can return to rotation after the probe recovers and the other readiness conditions are met.

The example uses Spring Boot 4.2.0, which Spring released on November 19, 2026 and listed as the latest stable release when the lab was verified. Spring Boot's 2.3 documentation already describes the Actuator liveness and readiness groups. The additional main-port paths are documented in 2.6. In 4.2, Boot maps the groups' health statuses to HTTP. With the defaults used here, UP produces 200, while DOWN and OUT_OF_SERVICE produce 503. Inspect the HTTP status when testing a custom mapping. A body that says DOWN with HTTP 200 would pass an HTTP probe. Spring Boot 4.2.0 release · Stable versions · Actuator HTTP status mapping · Boot 2.3 reference · Boot 2.6 reference

Give each probe its own timing budget

In the sample manifest, startup uses up to 30 failures at a two-second interval, liveness uses three at a ten-second interval, and readiness uses two at a five-second interval. These are example settings. Measure cold starts under the CPU and memory limits you deploy with. The startup allowance should cover slow but healthy boots. A liveness threshold should tolerate brief stalls and still detect a process that has stopped making progress. Readiness should respond quickly enough to stop routing to an unusable instance without flipping on every short spike. Kubernetes probe timing and thresholds

With the liveness settings above, take the first failing check as time zero. If the next two checks start ten and twenty seconds later and both fail, the third can trigger termination roughly twenty seconds after the first check started, plus the time for the final check to fail. The real recovery time also includes termination, restart backoff when applicable, and the time for the restarted process to become ready. Compare that recovery time with how long the original process takes to recover from the same stall. A restart that takes longer than the fault can make the incident worse. Kubernetes container restart behavior

Choose dependencies by what a failed probe would do

Suppose you add a check of the shipping partner to liveness. Each shop process calls the same service. During a partner outage the check fails on every replica. After the configured threshold, Kubernetes starts restarting healthy shop processes. The new processes encounter the same partner failure. The shop loses capacity to serve the catalog and may increase load on a partner that's trying to recover. Keep liveness focused on failures local to the instance that a restart could clear. Spring Boot's probe groups start with availability state and add no other health indicators by default. Spring Boot on external state in probes

For readiness, ask whether sending the request to another replica improves the outcome.

FailureReadiness decision and consequence
One replica has a broken local cacheMark that replica unready if the cache is required and another replica can serve the request. Let the affected process rebuild its cache while it runs.
A shared partner is needed only for shipping quotesKeep the shop ready so the catalog can still serve. Use a short timeout and cap concurrent calls to the partner so slow quotes cannot tie up the rest of the application.
A shared dependency is required for every requestDecide whether the Service should withdraw all endpoints or keep them ready to return a controlled error. Test what clients see and how they behave during recovery.

Imagine three replicas that each sustain 40 requests per second at an acceptable latency, with 75 requests per second arriving. With one replica out, capacity drops to 80 requests per second. A second loss leaves 40 and queues can grow. If all three use a common optional partner as a readiness check, one partner outage can withdraw all 120 requests per second of nominal capacity from normal Service routing, including the capacity that could still serve the catalog.

How much capacity stays in rotation? Illustrative model · 3 replicas × 40 requests/s · demand 75 requests/s
  • All replicas ready120 req/s
  • One replica unready80 req/s
  • Two replicas unready40 req/s
  • All replicas unready0 req/s

Incoming demand at 75 req/s

If all endpoints are unready, a normal Service can fail at the connection layer. An ingress might generate its own 503, with a different body from the shop's shipping_unavailable. An upstream failure may look the same to the user either way. To triage it, check whether the request reached the shop, whether the proxy had any ready upstreams and whether every replica saw the partner failure. For ordinary Service routing, compare the Pod's readiness with the endpoint's ready and terminating conditions. Review how your specific Service or ingress uses them, especially if the Service sets publishNotReadyAddresses. Spring Boot on shared dependencies · EndpointSlice conditions

If shipping and catalog need independent traffic policies over the long term, route them to independently deployable workloads and give each its own readiness criteria. Two routes or two Service names in front of the same Pods still share those Pods' readiness. You can usually start with timeouts and isolation in the application, then separate deployments if one function repeatedly exhausts the other's capacity.

Probe the port that serves traffic

The lab puts Actuator on port 8082 and the user API on 8080. The management listener could continue answering while the application listener cannot accept a new connection. Spring Boot provides additional paths for the same health groups on the main port. The lab enables the groups explicitly for a local run. Spring Boot on Kubernetes probes

server.port=8080
management.server.port=8082
management.endpoint.health.probes.enabled=true
management.endpoint.health.probes.add-additional-paths=true

The management check reaches port 8082. Main-port probes on 8080 exercise the application listener, and the shipping journey on 8080 also calls the partner.

In Kubernetes, point the probes at /livez and /readyz on the application port. The request then exercises the listener and the HTTP handling for that path. A listener that has stopped accepting connections can cause this probe to fail while port 8082 still responds. The main-port probe does not exercise the real ingress and its TLS, user authentication, the shipping handler or the partner's quote response. The manifest uses /livez as a startup milestone. Readiness still waits for the application's accepting-traffic state, which comes after Boot's startup runners. Spring Boot application lifecycle

Verify that the application can drain during a rollout

Readiness describes eligibility for routing. A request already in flight can continue, and the proxy needs time to observe endpoint changes. Spring Boot's graceful shutdown allows existing requests to finish during its configured shutdown phase. Test this with traffic through the real ingress during a staging rollout. Compare the last request sent to the terminating instance with the last response it completes. Leave enough Pod termination time for any lifecycle hook and for the application's shutdown phases. A successful readiness check on the new instance tells you when it can receive traffic. It gives you no evidence about requests the old instance was still serving. Spring Boot graceful shutdown · Kubernetes Pod termination

Check whether the user got what they came for

Run a read-only check from the same entry point as the customer. For a known fixture, request shipping options and require 200 plus the expected STANDARD option at EUR 4.99. In a real service, choose a stable dedicated test fixture and use credentials with read-only access if the path requires them. The lab makes a single quote request. It creates no order, payment or shipment.

The supplied synthetic.py records the journey name, outcome, HTTP status and elapsed time. During the outage, it reports http_error with 503. When the partner returns an empty list for this known fixture, the shop returns 200 and the check reports unexpected_result. This line was captured in the local run.

{"journey":"shipping_options","outcome":"unexpected_result","http_status":200,"elapsed_ms":28.7}

For the synthetic success rate, divide matching results by completed check attempts, including HTTP and transport failures. Monitor missing samples separately so a stopped monitor cannot silently improve the rate. For actual user traffic, count eligible quote attempts and how many produced a usable quote. Track an unsupported destination separately if it is a valid product outcome. Keep outcome labels bounded. For application-side examples of testing the telemetry you expect to emit, see the OpenTelemetry contracts guide.

Consider an illustrative five-minute window with 10,000 shop requests, including 200 eligible quote requests. Of those 200, 60 return 503 and another 20 return 200 without a usable option. The overall 503 rate is 0.6% if the other routes are healthy, and the quote route's 503 rate is 30%. The quote success rate is only 60% (120 usable quotes out of 200). The three percentages give the same team very different pictures of the incident.

Observe the customer-facing route at the ingress as well as inside the JVM. A failed request that never reaches the app cannot contribute to its request timer. Spring Boot instruments Spring MVC requests with http.server.requests by default. For instrumented downstream calls, use Boot's auto-configured RestClient.Builder or apply its observation customizer. The example lab constructs its client directly and verifies the quote outcome with the synthetic script. In production, compare server and partner timings for the same request when tracing is available. Use the route template and a bounded outcome such as usable_quote, no_service or partner_unavailable. Keep order IDs and postcodes out of metric labels. Spring Boot server and client metrics

Decide what to do during an incident

SignalWhat it tells youWhat action follows
Startup or liveness repeatedly failsThe process missed a startup milestone or stopped passing its local check.Let the restart policy act. If restart counts keep rising, inspect Pod events and the previous container's logs before rolling out more replacements.
Ready capacity fallsFewer endpoints can take normal traffic.Compare demand with remaining capacity. Investigate a sustained loss or zero ready endpoints. Check for a recent rollout or a shared dependency.
Route error rate risesMore requests ended in technical errors.Compare ingress errors with application errors. Use the response origin and partner results to choose the affected layer.
Route latency risesRequests take longer even when they eventually succeed.Compare the route's high-percentile latency and error rate together. Check the partner time and waiting in local pools.
Quote success rate fallsCustomers fail to get a usable option.Investigate the shop journey and the partner. Inspect empty 200 responses as well as explicit errors.

For the lab's partner outage, liveness and readiness stay green across the outage while the shipping request fails. In production, the same pattern across replicas points toward the shared journey or dependency. Keep serving the catalog while the shipping failure is investigated. If failures begin just after a rollout and occur only on new replicas, compare old and new replicas before assuming the partner is down. The same 503 can justify two different responses once you know where it started.

Try it yourself

Download the Spring Boot health probes lab (ZIP). Build with JDK 21 and Maven. The verifier uses Python 3 and starts the shop and its simulated partner on local ports. The ZIP includes manual commands and sample Kubernetes manifests.

mvn -B -ntp clean package
python -B verify.py --evidence http-evidence.json

The local executable JAR passed 31 recorded HTTP and synthetic checks, both from the workspace and after a fresh extraction and build of the ZIP. On the application port, a controlled readiness change moved /readyz from 200 UP to 503 OUT_OF_SERVICE and back to 200 UP. Throughout the refusing phase, /livez remained 200 UP, and a direct quote request still worked with the partner restored. That direct call demonstrates that changing Boot's availability state is a signal to a routing controller. The lab runs without Kubernetes. The routing and restart effects above follow the Kubernetes documentation. For a broader release check, see Spring Patch Thursday.

Probe configuration checklist

  • Write down the intended action on probe failure before choosing the checks.
  • Keep shared remote dependencies out of liveness. For readiness, work through what happens when every replica fails together.
  • Probe the application port when traffic depends on it. Verify the exact path and HTTP status using the deployed settings.
  • Size the startup allowance from measured boot times. Exercise readiness failure and recovery separately.
  • Test one safe user path through the real entry point and assert a meaningful result.