Skip to content
Engineering Bible
Kubernetes

Kubernetes on networking

Every Pod gets its own IP address

  • Any Pod can reach any other Pod directly, on any node, without address translation.
  • A network plugin (CNI plugin), such as Cilium or Calico, makes this work.
  • A new Pod gets a new IP, so never hard-code Pod IPs.

A Service is a stable address for a set of Pods

  • It selects Pods by label, such as app=web, and spreads traffic across the ready ones.
  • It gets a fixed virtual IP and a DNS name: web.shop.svc.cluster.local.
  • Inside the shop namespace the short name works: http://web.

The Service type decides who can reach it

  • ClusterIP is the default, and is right for traffic between your own apps.
  • LoadBalancer asks your cloud for an external load balancer for that one Service.
  • A headless Service has no virtual IP. Its DNS name returns the Pod IPs themselves.
TypeReachable fromHow
ClusterIP (default)Inside the clusterA virtual IP
NodePortOutside, through any nodeA port from 30000 to 32767 on each node
LoadBalancerOutside, through a cloud addressAn external load balancer
Headless (clusterIP: None)Inside the clusterDNS returns each Pod IP

Gateway API routes outside traffic to Services

  • One load balancer per Service adds up. Share one entry point and route by host and path.
  • A Gateway is that entry point: a listener, such as HTTP on port 80.
  • An HTTPRoute sends matching requests, such as shop.example.com/cart, to a Service.
  • Gateway API is an add-on. You install its resource types and a controller that runs it.
  1. Clientshop.example.com/cart
  2. Gatewaylistens on a port
  3. HTTPRoutematches host and path
  4. Servicestable virtual IP
  5. Podone of the ready ones
Platform teams own the Gateway. App teams attach their own HTTPRoutes to it.

Ingress still works, but it is frozen

  • Ingress is the older API for the same job. It is stable and will not be removed.
  • It gets no new features. The Kubernetes project recommends Gateway API instead.
  • The widely used ingress-nginx controller was retired in March 2026, with no more fixes.
  • If you still run ingress-nginx, move to Gateway API or to a maintained Ingress controller.

NetworkPolicy is the firewall between Pods

  • By default, every Pod accepts connections from every other Pod.
  • A NetworkPolicy selects Pods by label and lists who may connect in or out.
  • Start each namespace with a deny-all policy, then allow only what is needed.
  • Policies only work if the network plugin enforces them. If not, they do nothing.
Kubernetes in six pages3 / 6