Sacred Systems
Services, Service Discovery, and Traffic Flow
A Service is stable naming plus an endpoint set. When the endpoint set is wrong—or withheld by readiness—traffic becomes myth. Prove endpoints first.
Text
Authored as doctrine; evaluated as systems craft.
Doctrine
Services exist to give stable addressing over ephemeral pods. Kubernetes achieves this with selectors and an endpoint set. There is no magic beyond that: if endpoints are empty, routing cannot happen.
Kubblai doctrine: never debug ingress or DNS before you have proven endpoints.
- Selectors define membership; labels satisfy membership.
- Readiness controls eligibility; not-ready endpoints are withheld.
- Ports must align: service port, targetPort, and container listener.
EndpointSlices and readiness gating
EndpointSlices are the modern truth source for service backends. If they are empty, you have a selector mismatch or readiness gating.
If they are populated, you can test service reachability locally with port-forwarding to isolate ingress and DNS from the equation.
kubectl
shell
kubectl get svc,ep,endpointslices -n <ns>
kubectl describe svc <svc> -n <ns>
kubectl get pods -n <ns> -l app=<label> -o widekube-proxy and the cost of abstraction
Service routing is implemented by kube-proxy (iptables/ipvs) or equivalent mechanisms. You rarely need to debug kube-proxy itself—but you do need to remember that service routing depends on node networking health and consistent endpoint data.
When service routing fails intermittently, investigate endpoint churn, readiness flapping, and node-level partitions before you rewrite YAML.
Common failure modes
Most service failures are misalignments, not deep platform problems.
- Selector mismatch (one label off).
- Pods not Ready (readiness endpoint wrong, dependency gating).
- Port mismatch (service points at a port the pod never listens on).
- Namespace mismatch (service cannot target pods in another namespace).
Field notes
Services become unreliable when readiness becomes theatre. If readiness lies, traffic will follow the lie. Treat readiness as an SLO-aligned gate: serving ability, not process existence.
When in doubt: test the service directly. Then test ingress. Then test DNS.
Canonical Link
Canonical URL: /library/services-service-discovery-and-traffic-flow
Related Readings
Sacred Systems
LibraryLabels, Selectors, and the Geometry of Ownership
Labels are not tags. They are the geometry that determines ownership and routing. A single mismatch can silence traffic or orphan workloads.
Advanced Disciplines
LibraryIngress, Egress, and the Borders of the Mesh
Ingress is not a convenience; it is the public boundary of your system. Egress is the boundary you forget until it becomes the breach.
Advanced Disciplines
LibraryNetwork Policy and the Discipline of Isolation
Isolation is not paranoia; it is how you keep a single compromised workload from becoming a platform incident.
Advanced Disciplines
LibraryProbes, Liveness, Readiness, and the Test of Worthiness
A probe is a contract between the workload and the cluster. Poor probes turn minor latency into systemic failure.
Governance & Power
LibraryThe Cost of Tenant Illusions in Shared Clusters
Shared clusters promise efficiency. Without real isolation, they deliver shared outages: quota fights, RBAC mistakes, policy coupling, and security ambiguity.