Pcornel
Browse topics
Options
Recent
Favorites
Containers · Technical reference

Kubernetes Networking & Services

Direct answer

Kubernetes networking gives every pod an IP on a flat network (CNI); Services give a stable virtual IP and DNS name over a set of pods selected by labels; Ingress/Gateway expose HTTP from outside.

When to use this

Use it when pods cannot reach a Service or external clients cannot reach the application.

First 30 seconds

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.

Operational verification

client → DNS → Service VIP → kube-proxy/eBPF → ready endpoint pod

Evidence · next step

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
Common mistakes
What not to infer

Networking owns general IP/routing/DNS fundamentals. Containers owns Kubernetes Service/CNI/Ingress/Gateway object behavior and their mapping to workload endpoints.

Platform / version applicability
Docker / containerd / Podman / Kubernetes / OCI-compatible platforms
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformDocker / containerd / Podman / Kubernetes / OCI-compatible platforms · Networking owns general IP/routing/DNS fundamentals. Containers owns Kubernetes Service/CNI/Ingress/Gateway object behavior and their mapping to workload endpoints.
Scope / prerequisiteUse it when pods cannot reach a Service or external clients cannot reach the application.
What next?3 suggested next steps
Child topics (this level)3
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

2 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

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

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.

Evidence references

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.

test · 1
Drill down

Subtopics

Go one level deeper into this subject.

Key points

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.

Key checks
  • kubectl get svc,endpointslices -n <ns> — first check for this topic
  • kubectl get pods -o wide — pods, status, node, IP
  • kubectl describe pod <pod> — events and conditions
  • kubectl 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.

ObjectPurpose
Service (ClusterIP)Stable internal IP and DNS name
NodePort / LoadBalancerExternal access via node ports or cloud/MetalLB load balancer
Headless ServiceDNS records per pod (StatefulSets)
Ingress / Gateway APIHTTP routing, TLS termination
NetworkPolicyAllow-list pod traffic (needs a supporting CNI)
CoreDNSsvc.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
Technical examples

Configuration & expected output

Concrete examples are shown only when the stored reference contains an actual configuration or output shape for this Topic.

Configuration example

Kubernetes Kubernetes 1.28 or laterClusterIP Service selecting the api Pods.

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: 8080

Expected output

Kubernetes Kubernetes 1.28 or laterkubectl get endpointslices -l kubernetes.io/service-name=api

Expected 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   5m
No 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.
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-29 · otherOCI / Docker / containerd / Kubernetes Kubernetes current documentation

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%
Technical changelog & impact

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.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Terminology layer

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.

Aliases that resolve here
kubernetes networking & servicesKubernetes ServiceClusterIP NodePort LoadBalancerKubernetes DNSNetworkPolicy
Embedded reference data

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.

BoundaryInspectHealthy interpretationDo not infer
IntentCluster networking modelIntended object/scope is explicit and versioned where relevantIntent is already effective
Owning runtime/control planeService ClusterIP/NodePort/LoadBalancer / kube-proxy responsibilityOwner accepts and reports the expected object stateDownstream dependencies are healthy
Effective stateCluster DNSIndependent read-back matches the intended stateEvery client sees the same result
Consumer outcomeIngress and Gateway conceptsThe original bounded check succeeds in the same time windowProduction correctness outside this scope
Depth when you need it

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.

Confirmation

Confirm action

Continue?