Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

For a Node.js service, use separate health signals for separate decisions: Kubernetes readiness controls whether a Pod receives Service traffic, liveness can trigger a container restart, and startup gives slow initialization time to finish before the other probes begin. A Docker HEALTHCHECK records container health, but it does not decide Kubernetes Service routing. The practical starting point is a fast local HTTP endpoint, with readiness and liveness paths given distinct meanings when the service depends on other systems.

What is the difference between readiness, liveness, and startup probes?

They answer three different operational questions. Readiness asks whether the application should receive traffic now; liveness asks whether its process can still make progress; startup asks whether initialization has completed far enough for the other checks to be meaningful.

Check What a failure means What Kubernetes does Useful scope
Startup The application has not yet completed startup. While the configured startup probe has not succeeded, Kubernetes does not run readiness or liveness probes. If startup keeps failing until its configured failure budget is exhausted, Kubernetes treats the container as failed and restarts it. Initialization that takes longer than ordinary liveness timing allows.
Readiness The application should not accept traffic at this moment. Marks the Pod unready and removes it from matching Service EndpointSlices; the process continues running. Whether this instance can safely serve its intended workload, including required dependencies when appropriate.
Liveness The process is in a condition from which it cannot recover by continuing to run. Repeated failures cause the kubelet to restart the container. A condition such as a deadlock or a process that has stopped making progress.

This distinction matters because the actions have different costs. A readiness failure temporarily drains traffic from one Pod. A liveness failure can interrupt work by restarting its container. Startup is a gate: it prevents a slow but still initializing application from being judged by its normal ongoing health rules too early.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Kubernetes describes startup probes as verifying whether the application within a container is started, and readiness probes as determining when a container is ready to accept traffic. A probe is only as informative as the condition its handler actually checks; a successful HTTP response is not proof of a complete end-to-end user transaction.

#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter | 4Pack Type C Female to A Male Cable Converter for Apple Duo 17 16 15 14 Plus,iWatch Watch 12 11 10,iPad 9 8 Air,Airpods 5 4
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

How should a Node.js service define its health endpoints?

Keep a health handler cheap, local, and predictable. It should return promptly rather than doing expensive work on every probe, and its response should reflect the specific condition Kubernetes is meant to act on.

Use liveness to detect a process that cannot make progress

A liveness route should answer whether the Node.js process is functioning well enough to continue. It should not fail simply because a database or queue is temporarily unavailable: restarting every application container during a shared backend outage may amplify the incident rather than repair the cause. A basic Express route can return a quick success response:

app.get("/live", (_req, res) => {
  res.json({ status: "ok" });
});

This basic handler demonstrates the response shape, not a universal definition of liveness. A service with a known way to detect an unrecoverable internal condition can incorporate that state, but the check should not turn ordinary dependency slowness into a restart signal.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use readiness for the ability to serve the intended workload

Readiness may include conditions beyond process existence. If a database or queue is essential for the service to accept requests safely, readiness can report failure while that dependency is unavailable. Kubernetes then stops routing Service traffic to that Pod without terminating the running process.

app.get("/ready", (_req, res) => {
  if (!isReadyForTraffic) {
    return res.status(503).json({ status: "not_ready" });
  }
  res.json({ status: "ready" });
});

isReadyForTraffic is application state, not a built-in Node.js variable. The service must define and update it using checks appropriate to its behavior. Avoid turning the route into a burst of expensive dependency calls each time it is probed; a cheap state check can be safer than repeated network fan-out. Validate the dependency scope and failure thresholds against the service’s own latency and recovery behavior.

Rank #2
Sale
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter | USB C Dongle with 90W Max Power Delivery, 3×5Gbps USB A Data Ports, for MacBook, Dell, and More (Charger Not Included)
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Choose one route or separate routes based on meaning

A single endpoint can serve multiple probes only when “started,” “ready for traffic,” and “able to make progress” genuinely mean the same thing for that application. If dependency loss should drain traffic but should not restart a still-functional process, keep readiness and liveness semantics separate. A startup path can report whether initialization is complete; it need not be a permanent check with the same meaning as readiness.

How do I add a Docker health check to a Node.js image?

Add a Dockerfile HEALTHCHECK that makes an HTTP request to the service inside the container and exits with success or failure. Docker’s HEALTHCHECK instruction tells Docker how to test whether a container is still working; Docker maintains a container-local health state rather than Kubernetes Service routing state.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
HEALTHCHECK --interval=30s --timeout=3s --start-period=20s --retries=3 
  CMD node -e "require('http').get('http://127.0.0.1:3000/health', r => process.exit(r.statusCode >= 200 && r.statusCode < 400 ? 0 : 1)).on('error', () => process.exit(1))"

In this example, the check uses Node’s built-in HTTP client, requests the service on loopback port 3000, and treats HTTP responses from 200 through 399 as successful. A connection error exits unsuccessfully. The route and port must match the application in the image. The example uses a three-second timeout and a twenty-second start period; those are chosen example settings, not Docker defaults or universal recommendations.

Docker documents defaults of a 30-second interval, a 30-second timeout, a zero-second start period, and three retries. A health check returns exit code 0 for success and exit code 1 for unhealthy. Keep check output short because Docker stores only a limited amount of it. The example’s use of Node avoids assuming that a minimal image contains a separate utility such as curl, but test the command in the built image rather than assuming it works in every image configuration.

How do I configure Kubernetes probes for a Node.js container?

Define HTTP probes in the container specification and align each path with the condition it represents. Here is a starting pattern with a 300-second startup failure budget and separate readiness and liveness checks:

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter | 85W Max PD, 2 USB 3.0 & 1 USBC Data Ports, SD/TF Card Reader, for Laptops/Mac and Other Type C Devices (Charger Not Included)
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
startupProbe:
  httpGet:
    path: /health
    port: 3000
  periodSeconds: 10
  failureThreshold: 30

readinessProbe:
  httpGet:
    path: /ready
    port: 3000
  periodSeconds: 10
  timeoutSeconds: 2
  failureThreshold: 3

livenessProbe:
  httpGet:
    path: /live
    port: 3000
  periodSeconds: 10
  timeoutSeconds: 2
  failureThreshold: 3

In a Kubernetes Pod manifest, these fields belong under the relevant container alongside its image and other container settings. The path must be served by the application on the specified port. Kubernetes treats HTTP status codes from 200 through 399 as successful probe responses.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The startup budget in this example follows Kubernetes’ documented formula: failureThreshold × periodSeconds, or 30 × 10 = 300 seconds. It is a ceiling for startup failures under those settings, not a promise that every application will be given precisely 300 seconds in all circumstances. Kubernetes’ documented default probe period is 10 seconds and default timeout is 1 second. The example explicitly sets a two-second timeout for readiness and liveness instead of relying on that default. Verify behavior against the Kubernetes version and cluster configuration in use.

Once startup succeeds, the readiness and liveness probes become active. Configure their budgets around measured startup time and normal response latency: a timeout or failure threshold that is too strict can interpret a slow but recoverable service as broken. Conversely, a very forgiving readiness check can leave traffic directed to an instance that cannot serve its work.

How should I choose probe timing and dependency scope?

Design timing and endpoint behavior together. A cheap process-local check can be sampled frequently without creating significant work; a check that fans out to a database or queue can become costly and can fail because of backend latency outside the process’s control.

  • Startup: allow enough failure budget for the real initialization path, including the service’s observed slow starts. The example’s 300-second ceiling is illustrative; do not copy it without comparing it with this service’s startup behavior.
  • Readiness: decide which dependencies are truly required before sending traffic. If a dependency failure means the instance cannot safely handle requests, mark it unready; avoid coupling unrelated optional integrations to traffic admission.
  • Liveness: keep the condition narrow enough that ordinary load spikes and backend outages do not cause avoidable restarts. Kubernetes warns that expensive or overly aggressive liveness checks can reduce scalability and overload the Pods that remain.
  • Timeout and period: use a timeout that allows normal probe response latency, then select a period and failure threshold that fit the expected recovery behavior. Kubernetes documents defaults of a 10-second period and a 1-second timeout; they are not necessarily suitable for every service.
  • Docker check: treat Docker’s interval, timeout, start period, and retries as a separate schedule. Its documented defaults are a 30-second interval, 30-second timeout, zero-second start period, and three retries.

Before adopting numbers, observe how long the service takes to initialize, how quickly its endpoints respond under representative load, and how dependencies recover. The available guidance establishes no workload-specific benchmark or universally correct thresholds. The point of a probe is to make a defensible operational decision, not simply to make the container display a green status.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray | Data transfer & Fast charging for MacBook, iPhone 17/16/15, iPad, Samsung Galaxy, Apple Watch
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Why might a Pod restart, receive traffic too early, or show conflicting health?

Look first at which signal failed and what action it controls. A restart is usually a liveness or startup consequence, while traffic reaching an unsuitable instance points to readiness behavior or its configuration.

The container restarts while the app is still booting

If liveness starts before initialization completes, slow startup can be mistaken for an unrecoverable process failure. Configure a startup probe with a budget that reflects the service’s real initialization time; Kubernetes pauses liveness and readiness checks until startup succeeds. If the application does not complete within that budget, inspect startup logs and the startup route’s response before simply increasing thresholds.

Traffic reaches an instance that cannot serve requests

Check whether a readiness probe exists, whether its path and port match the running application, and whether its response actually represents the conditions needed for the workload. A route that only confirms the Node.js process exists may remain successful when a required dependency is down. In that case, readiness needs an appropriate dependency-aware state, while liveness should retain its distinct process-recovery purpose.

Pods restart more often when the service is busy

A liveness handler that performs slow dependency checks can time out under load even while the process could recover normally. Kubernetes cautions that poorly designed liveness probes can hurt scalability and contribute to overload among remaining Pods. Make liveness inexpensive, review normal probe latency, and set timing and thresholds based on measured service behavior rather than copying a sample unchanged.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Docker reports healthy but Kubernetes sends no traffic, or the reverse

These systems track separate signals. Docker’s health state does not itself implement Kubernetes readiness or Service routing, and a Docker check may use a different path, timing budget, or condition from the Pod’s probes. Inspect the container’s health state with docker inspect, then examine Pod conditions and Kubernetes events to determine which Kubernetes probe is failing.

Best Value
Sale
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display | 85W Max PD, 1 Powered USB-C 5Gbps & 2 Powered USB-A 3.0 5Gbps Data Ports, for MacBook Pro, MacBook Air, Dell and More (Black)
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

The probe command fails only in the built image

A command can rely on an executable or file that exists in a development environment but is absent from a minimal production image. A Node-based request avoids assuming an extra package, but it can still fail if the application listens on another port, the path is wrong, or the Node command is unavailable in the image’s runtime setup. Exercise the exact check against the built image and verify the path, port, and response behavior.

What can a health check prove about a nightly SaaS service?

A health check proves only the conditions its endpoint evaluates at the moment it runs. A successful liveness response does not prove that a customer request will complete, a database contains correct data, or a nightly job has finished. A successful readiness response is useful for traffic decisions only if its checks match what the service needs to serve its intended workload.

If completing a nightly job is an operational requirement, represent that completion with the application’s job state or a separate monitoring signal rather than assuming a generic HTTP health response implies it. Keep routine process health, traffic eligibility, and business-work completion distinct so an operator can tell whether the process is alive, whether it should receive traffic, and whether its scheduled work has reached the required state.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How can I evaluate a probe design before relying on it?

Review the design against the decision each check drives, then exercise expected failures. A good configuration makes it possible to understand why traffic was removed or a container restarted, without causing the check itself to create unnecessary load.

  • Failure action: confirm that an unavailable dependency changes readiness when it should drain traffic, without automatically making that same condition a liveness failure.
  • Lifecycle: verify that startup protects initialization and that ongoing checks begin only after startup succeeds.
  • Dependency scope: list which backend systems are essential for safe request handling and which are optional. Include only relevant conditions in readiness.
  • Cost: check whether a probe triggers a new network request or other expensive work on every interval. Avoid uncontrolled fan-out.
  • Timing budget: compare startup budget with observed initialization, and compare timeout and failure thresholds with normal endpoint latency and recovery time.
  • Debuggability: make endpoint status, application logs, container health output, Pod conditions, and events useful for identifying the failed condition.

Test both normal and failure cases: startup that takes longer than usual, a required dependency becoming unavailable, and a process that stops making progress. Confirm that each case causes the intended response—wait, remove traffic, or restart—rather than relying on a successful response in a single happy-path test.

Frequently Asked Questions

Does a Kubernetes readiness failure kill a Node.js process?

No. Readiness changes whether the Pod is eligible for traffic through matching Services; the application process can continue running. That is useful when an instance should be drained temporarily while it recovers or waits for a required condition.

Can a health check tell me whether a nightly job completed successfully?

Only if the endpoint explicitly checks and reports the job’s completion state. A generic process or HTTP health response cannot establish that scheduled business work finished.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why is my Docker health status different from my Pod’s readiness status?

Docker and Kubernetes maintain different health signals, and their checks may use different endpoints, schedules, and criteria. Compare the exact commands and response conditions rather than assuming one status mirrors the other.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.