Kubernetes Ingress vs Gateway API
Two ways to bring outside traffic into a cluster, and why Gateway API is the successor.
Services inside a cluster are not reachable from the internet by default. Ingress is the original API for HTTP routing into the cluster; the Gateway API is its more expressive, role-oriented successor.
Both are specifications. A controller — NGINX, Traefik, Envoy Gateway, Istio, a cloud load balancer — actually implements the routing.
Diagram
Key concepts
- Ingress
- One resource with host and path rules. Advanced features rely on controller-specific annotations.
- GatewayClass
- Defines which controller implements gateways — set up by the infrastructure provider.
- Gateway
- A listener (ports, TLS, hostnames) managed by the cluster operator.
- HTTPRoute / GRPCRoute
- Routing rules owned by application teams, attached to a gateway.
- Traffic splitting
- Gateway API supports weighted backends natively — useful for canaries.
Trade-offs
Benefits
- Ingress: simple, mature, supported everywhere
- Gateway API: role separation, portable advanced routing, TCP/UDP/gRPC routes, header matching and weights
Costs
- Ingress: annotations differ per controller, so configs are not portable
- Gateway API: more resources to learn, controller support still varies by feature
Use it when
- Ingress for simple HTTP routing in existing clusters
- Gateway API for new platforms, multi-team clusters and canary routing
Common mistakes
- Relying on controller-specific annotations without documenting them
- Allowing any namespace to attach routes to a shared gateway
- Terminating TLS without automating certificate renewal (use cert-manager)
Interview questions
Q1Why was the Gateway API created?
Ingress was limited to basic HTTP routing, with everything else in non-portable annotations. Gateway API provides a richer, standard model and separates infrastructure, operator and developer roles.
Q2Is an API gateway the same as a Kubernetes Gateway?
Not exactly. A Kubernetes Gateway handles traffic entry and routing. Full API gateways add API keys, quotas, developer portals and transformations, though some products do both.
Q3How would you do a canary with Gateway API?
Use an HTTPRoute with two backendRefs — v1 with weight 95 and v2 with weight 5 — and adjust the weights as metrics stay healthy.
Related lessons
Cloud & Delivery
Kubernetes Architecture
The control plane, worker nodes and core objects that run containers at scale.
APIs & SecurityAPI Gateway
A single front door that routes, secures and shapes traffic to your back-end services.
Scalability & PerformanceLoad Balancing
Spread traffic across healthy servers so no single machine becomes the bottleneck.