Use it when pods cannot reach a Service or external clients cannot reach the application.
Kubernetes Networking & Services
1. kubectl get svc,endpointslices -n <ns> — endpoints present?
2. Selector matches pod labels and pods are Ready?
3. From a pod: nslookup <svc> and curl <svc>:<port>.
4. NetworkPolicy affecting the pods?
5. Ingress: controller logs and backend Service.
client → DNS → Service VIP → kube-proxy/eBPF → ready endpoint pod
Typical failures are empty endpoints from selector mismatch, wrong targetPort, DNS name/scope confusion, source-NAT assumptions, external load-balancer health checks hitting the wrong path, and NetworkPolicy allowing one direction but blocking reply/dependency traffic. Preserve the first divergent observation and repeat the same bounded verification after remediation.
Continue only after interpreting the current observation.Context & applicabilityCommon mistakes · platform/version boundaries
Networking owns general IP/routing/DNS fundamentals. Containers owns Kubernetes Service/CNI/Ingress/Gateway object behavior and their mapping to workload endpoints.
Operational reference
Fast context before you go deeper.
Verification & 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 workflow Verify boundary
Verify Pod IP reachability, Service selector/endpoints, Service port/targetPort, DNS answers and the actual ingress/load-balancer path separately. Test from both inside and outside the cluster where relevant, and inspect NetworkPolicy or provider policy before blaming the application.
Step 2 Failure signatures and limits Narrow the fault
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.
Subtopics
Go one level deeper into this subject.
Kubernetes Services give a stable virtual IP and DNS name to a set of Pods; types ClusterIP, NodePort and LoadBalancer decide where it is reachable.
Subtopic Ingress and Gateway APIIngress and the newer Gateway API route external HTTP(S) traffic to Services by host name and path through an ingress or gateway controller.
Subtopic NetworkPolicyNetworkPolicy objects restrict which Pods and namespaces may talk to selected Pods; once a Pod is selected, only explicitly allowed traffic passes.
A Service with no endpoints means its selector matches no ready pods. DNS name: <svc>.<ns>.svc.cluster.local. NetworkPolicies may block traffic once any policy selects a pod.
kubectl get svc,endpointslices -n <ns>— first check for this topickubectl get pods -o wide— pods, status, node, IPkubectl describe pod <pod>— events and conditionskubectl logs <pod> [-c <c>] [--previous]— container logs (incl. previous crash)kubectl get events --sort-by=.lastTimestamp— recent cluster events
ReferenceWhat it is1 section · depth on demand
Operating model
Kubernetes Networking & Services connects Pod addressing to stable service discovery and ingress/egress paths. Services select endpoints and provide stable virtual access; DNS maps names; implementation-specific proxies/dataplanes steer traffic; Ingress/Gateway resources publish application routes above the Service layer.
ReferenceHow it works1 section · depth on demand
In depth
Kubernetes networking gives every pod its own IP address, lets all pods communicate without NAT (subject to network policies), and provides Services as stable virtual endpoints in front of changing sets of pods. Ingress or Gateway API resources expose HTTP(S) services externally.
| Object | Purpose |
|---|---|
| Service (ClusterIP) | Stable internal IP and DNS name |
| NodePort / LoadBalancer | External access via node ports or cloud/MetalLB load balancer |
| Headless Service | DNS records per pod (StatefulSets) |
| Ingress / Gateway API | HTTP routing, TLS termination |
| NetworkPolicy | Allow-list pod traffic (needs a supporting CNI) |
| CoreDNS | svc.namespace.svc.cluster.local names |
kubectl get svc,endpointslices -n apps
kubectl run -it --rm dbg --image=busybox -- nslookup api.apps.svc.cluster.local
kubectl get networkpolicy -A
Without NetworkPolicies, every pod can reach every other pod — apply a default-deny policy per namespace and allow required flows explicitly.
ReferenceImportant terms & boundaries1 section · depth on demand
Scope map
- Cluster networking model
- Service ClusterIP/NodePort/LoadBalancer
- kube-proxy responsibility
- Cluster DNS
- Ingress and Gateway concepts
- NetworkPolicy
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Configuration & expected output
Concrete examples are shown only when the stored reference contains an actual configuration or output shape for this Topic.
Configuration example
Assumptions: Pods carry the label app=api and listen on 8080.
apiVersion: v1
kind: Service
metadata:
name: api
spec:
selector: {app: api}
ports:
- port: 80
targetPort: 8080Expected output
kubectl get endpointslices -l kubernetes.io/service-name=apiExpected state: The Service has one ready endpoint per ready Pod on port 8080.
NAME ADDRESSTYPE PORTS ENDPOINTS AGE
api-7x2kq IPv4 8080 10.244.1.12,10.244.2.8,10.244.3.5 5mNo endpoints means the selector matches no ready Pods; check labels and readiness before suspecting kube-proxy or DNS. Illustrative authored output: field layout matches the tool, values will differ in your environment.Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Documentation verification: confirms the upstream model used by the Topic. It does not assert local production behavior.
Basis: https://kubernetes.io/docs/concepts/services-networking/ · confidence 92%What changed and what may be affected
Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.
Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
Kubernetes Networking & Services verification boundary matrix
A compact lookup separating intent, owning component state, effective state and consumer-visible outcome for Kubernetes Networking & Services.
| Boundary | Inspect | Healthy interpretation | Do not infer |
|---|---|---|---|
| Intent | Cluster networking model | Intended object/scope is explicit and versioned where relevant | Intent is already effective |
| Owning runtime/control plane | Service ClusterIP/NodePort/LoadBalancer / kube-proxy responsibility | Owner accepts and reports the expected object state | Downstream dependencies are healthy |
| Effective state | Cluster DNS | Independent read-back matches the intended state | Every client sees the same result |
| Consumer outcome | Ingress and Gateway concepts | The original bounded check succeeds in the same time window | Production correctness outside this scope |
Deep reference
Design & tradeoffs
Scope
Networking owns general IP/routing/DNS fundamentals. Containers owns Kubernetes Service/CNI/Ingress/Gateway object behavior and their mapping to workload endpoints.