← Kubernetes: operate workloads and recover services
02 / 6 · 40 MIN

Traffic and probes

Follow a connection path and distinguish readiness, startup, and restart.

Concept and mechanism

A Service provides a logical access point to destinations that can change. In the ordinary selector-based case, Pod labels determine candidates and EndpointSlices represent observed destinations. The Service port and targetPort serve different purposes: the former receives service connections and the latter identifies the destination listener. A resolved DNS name does not establish that ready endpoints exist or that the application accepts the configured port. Follow the path by layer: resolution, Service, selection, readiness, port, and application function. Keep the namespace explicit to avoid comparing same-named objects from different environments or changing a Service uninvolved in the incident.

Guided application

Probes should represent different decisions. Readiness indicates whether the container is ready for traffic through the ordinary Service; failure does not itself mean restarting. Liveness should detect a condition where restarting helps, avoiding turning a shared database outage into restarts of every API. Startup protects slow initialization before other checks become active. In an original exercise, an application takes about 110 seconds to load data, but early liveness repeatedly kills it. Measure startup and define a startup probe with suitable headroom while retaining readiness and later failure detection. The nominal budget follows the configured period and threshold; it is not a business recovery-time promise.

IN PRACTICE

DNS works, but selector app=ledger does not match app=ledger-api: inspect endpoints before changing DNS.

Common pitfalls

Readiness as restart; liveness dependent on all infrastructure; DNS as proof of service.

Related topics: Workloads and desired state · Resources and scheduling · Configuration and data

Take this idea with you

Each probe and port should have a verifiable purpose.

Create account

Reference: Liveness readiness and startup probes · Kubernetes v1.37 concepts; current official documentation consulted 2026-09-30; cluster versions and plugin capabilities must be confirmed