Use this when exposing pods with Kubernetes Services.
Services
1. Services expose pods.
2. Selectors must match pod labels.
3. Empty endpoints = selector/readiness issue.
4. Minimal external exposure.
5. Automate with manifests.
Service selector → ready pods → endpoints
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
kubectl get svc,endpoints webVerification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification path Verify boundary
The negative fixture should deliberately exercise risks such as schema drift, selector overreach, admission rejection, controller lag, immutable fields, stale status and confusing created object with ready workload, choosing the cases most relevant to Service selector/ports/type, EndpointSlice population, cluster/external traffic behavior and verifying reachable endpoints rather than only object existence.
Step 2 Example Narrow the fault
kubectl get svc,endpoints web
Step 3 Common mistakes Narrow the fault
- Selector labels not matching pod labels (no endpoints).
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Services give stable IPs and DNS names.
- Selectors must match pod labels.
- Endpoints show which pods receive traffic.
kubectl get svc,endpointslices -n <ns>— services and endpointskubectl describe svc <n>— selectors- Service type (ClusterIP/LoadBalancer) — exposure
ReferenceWhy it matters1 section · depth on demand
What it is
A Service gives pods a stable virtual IP and DNS name and load-balances to matching pods (ClusterIP, NodePort, LoadBalancer).
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
A Service gives a stable name and IP address to a changing set of pods, selected by labels, and load-balances traffic across them. Pods come and go with new IPs; the Service stays the same.
| Type | Reachable from |
|---|---|
| ClusterIP (default) | Inside the cluster |
| NodePort | Each node's IP on a high port |
| LoadBalancer | External load balancer (cloud or MetalLB) |
| ExternalName | DNS alias to an outside name |
The most common Service problem is a selector that matches no pods — the Service exists but has no endpoints.
kubectl get svc netbox-sync
kubectl get endpointslices -l kubernetes.io/service-name=netbox-sync
kubectl run tmp --rm -it --image=busybox -- wget -qO- http://netbox-sync:8080/health
Mechanics
The linked authority for bounded mechanics is Kubernetes Docs — Service; documentation support is separate from observed lab/production Evidence.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Kubernetes Automation > Services. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://kubernetes.io/docs/concepts/services-networking/service/ · confidence 94%Deep reference
Healthy vs suspicious evidence
Output interpretation
For Service selector/ports/type, EndpointSlice population, cluster/external traffic behavior and verifying reachable endpoints rather than only object existence, prefer typed fields and stable IDs over human presentation text.