Course outline

Kubernetes / Intermediate: rollout, policy, and evidence / Lesson 14

Trace Service backends with EndpointSlices

Compare selectors, endpoint conditions and ports when investigating Kubernetes Service traffic.

About 3 min readContent reviewed
On this page

Lesson goals

  • Explain how selected Pods relate to EndpointSlices.
  • Interpret endpoint readiness and termination conditions.
  • Design a bounded Service-path investigation.

Trace selection first

A Service with a selector normally has EndpointSlices managed for its selected Pods. Compare the Service namespace and selector with the actual Pod labels before investigating packet forwarding. The records here are synthetic; they are not API output and make no cluster request. A matching selector is necessary for this example but does not prove that the application listens or that clients can reach it.

Compare labels and ports

The first record shows matching fictional labels and an expected backend port. Check the Service port, target port and protocol against the application listener; they need not all use the same number. A Service can have more than one EndpointSlice, so inspect the full set for that Service rather than drawing conclusions from a single slice. Selectorless Services require their own endpoint management.

yaml Synthetic selection
service: catalog
selector: app=catalog
pod_labels: app=catalog
expected_port: 8080

The record is a comparison checklist, not a Service manifest or observed state.

Interpret endpoint conditions

EndpointSlice conditions include ready, serving and terminating. A terminating endpoint may still report serving while ready is false; the exact consumer behavior and Service configuration matter. The second record illustrates this combination, not a guarantee that traffic is draining correctly. Review the documented exceptions such as publishNotReadyAddresses and the cluster version when interpreting actual values.

yaml Synthetic endpoint condition
endpoint: synthetic-pod-address
ready: false
serving: true
terminating: true

The record illustrates distinct conditions and does not prove traffic reached this endpoint.

Separate path failures

If an expected endpoint is missing, compare selectors, Pod readiness and controller evidence. If the endpoint exists but requests fail, investigate the backend listener, Service ports, network policies and client path separately. A successful DNS lookup establishes name resolution, not a working transport or application response. Avoid changing selectors or disabling policy without evidence of the relevant fault.

Verify a bounded change

In an isolated authorized lab, send a controlled request from the intended client context and compare the result before and after a reviewed correction. Confirm the expected endpoint set and a neighboring denied path when applicable. Preserve sanitized timing and target evidence. A healthy endpoint observation at one moment does not guarantee capacity or availability throughout a rollout.

Common errors and fixes

A running Pod is assumed to be a ready endpoint

Why it happens
Pod process state and endpoint conditions differ.
How to fix it
Inspect readiness, selector and EndpointSlice conditions.
Prevent it next time
Test startup and termination behavior.

One slice is treated as the entire Service

Why it happens
A Service may have several EndpointSlices.
How to fix it
Inspect all slices associated with the Service.
Prevent it next time
Record the complete endpoint set.

DNS success is treated as application success

Why it happens
Name resolution does not prove the network or listener path.
How to fix it
Test the specific backend and Service path in an approved lab.
Prevent it next time
Monitor each layer separately.

2 practice exercises

1. The selector matches but the endpoint is not ready. What next?

Show worked solution

Inspect Pod readiness and endpoint conditions, then the listener and relevant events. Matching labels alone do not establish readiness.

2. A terminating endpoint is serving but not ready. Is traffic draining proven?

Show worked solution

No. Those conditions describe state; observe the actual consumer and traffic behavior under an authorized test.

Key takeaways

  • Compare selector, labels and the full endpoint set.
  • Read ready, serving and terminating independently.
  • DNS, transport and response are separate evidence.

Official references