Skip to content

Services and Networking

External exposure and in-cluster network isolation are central to both reachability and security on Kubernetes. This section covers Service, Ingress, NetworkPolicy and the next-generation Gateway API.

Quick Navigation

SectionContentWhen to Read
Service / IngressService types and Ingress layer-7 routingExpose applications and front them with a load balancer
NetworkPolicyPod- and Namespace-level ingress/egress policyNetwork isolation between microservices
Gateway APIGatewayClass, Gateway, HTTPRoute and other next-generation APIsComplex routing, cross-namespace and multi-protocol gateways
  1. Expose first, tighten second — when shipping a service, start with Service / Ingress to make it reachable;
  2. Layer on security — use NetworkPolicy to restrict Pod-to-Pod traffic at the namespace or service level;
  3. Move to Gateway API last — when you outgrow Ingress (many rules, cross-namespace sharing, or advanced TCP / TLS needs), migrate to Gateway API.

Picking the right backend

  • If the cluster already has the Gateway API CRDs (gateway.networking.k8s.io), go straight to Gateway API;
  • If the cluster only has Ingress-NGINX or another classic Ingress, keep using Service / Ingress.