The next generation of Kubernetes traffic management — more expressive, role-oriented, and portable than Ingress.
| Feature | Ingress | Gateway API |
|---|---|---|
| API maturity | v1 (frozen) | v1 (actively evolving) |
| Protocol support | HTTP/HTTPS only | HTTP, TLS, TCP, gRPC, UDP |
| Role separation | None | Infrastructure / Cluster / App developer |
| Header manipulation | Annotation hacks | Native filters |
| Traffic splitting | Not standard | Built-in backendRefs weights |
| Cross-namespace | Not supported | ReferenceGrant |
| Portability | Annotation-dependent | Portable core spec |
Manages GatewayClass — defines which controller handles Gateways (e.g. Envoy, Istio).
Manages Gateway — configures listeners, ports, TLS certificates, and which namespaces can attach routes.
Manages HTTPRoute / TLSRoute / GRPCRoute — defines how traffic reaches their services.
# Infrastructure Provider
apiVersion: gateway.networking.k8s.io/v1
kind: GatewayClass
metadata:
name: envoy
spec:
controllerName: gateway.envoyproxy.io/gatewayclass-controller
parametersRef:
group: gateway.envoyproxy.io
kind: EnvoyProxy
name: custom-proxy
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: {{ include "mychart.fullname" . }}
namespace: {{ .Release.Namespace }}
spec:
gatewayClassName: {{ .Values.gateway.className }}
listeners:
- name: http
port: 80
protocol: HTTP
hostname: "*.{{ .Values.gateway.domain }}"
allowedRoutes:
namespaces:
from: Selector
selector:
matchLabels:
gateway-access: "true"
- name: https
port: 443
protocol: HTTPS
hostname: "*.{{ .Values.gateway.domain }}"
tls:
mode: Terminate
certificateRefs:
- name: {{ .Values.gateway.tlsSecretName }}
allowedRoutes:
namespaces:
from: All
allowedRoutes.namespaces.from can be All, Same, or Selector — controlling which namespaces may attach routes to this listener.apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: {{ include "mychart.fullname" . }}
spec:
parentRefs:
- name: {{ .Values.gateway.name }}
namespace: {{ .Values.gateway.namespace }}
sectionName: https
hostnames:
- {{ .Values.httpRoute.hostname }}
rules:
- matches:
- path:
type: PathPrefix
value: /api
headers:
- name: x-api-version
value: v2
filters:
- type: RequestHeaderModifier
requestHeaderModifier:
add:
- name: x-routed-by
value: gateway-api
backendRefs:
- name: {{ include "mychart.fullname" . }}-api
port: {{ .Values.service.port }}
weight: 90
- name: {{ include "mychart.fullname" . }}-api-canary
port: {{ .Values.service.port }}
weight: 10
backendRefs enable canary deployments natively — no annotation gymnastics required.apiVersion: gateway.networking.k8s.io/v1beta1
kind: ReferenceGrant
metadata:
name: allow-from-web
namespace: backend
spec:
from:
- group: gateway.networking.k8s.io
kind: HTTPRoute
namespace: web
to:
- group: ""
kind: Service
Allows HTTPRoutes in the web namespace to reference Services in the backend namespace.
# Install Gateway API CRDs (standard channel)
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.2.0/standard-install.yaml
# Or experimental channel (includes TCPRoute, TLSRoute, GRPCRoute)
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.2.0/experimental-install.yaml
| Implementation | Controller Name | Notes |
|---|---|---|
| Envoy Gateway | gateway.envoyproxy.io/gatewayclass-controller | Reference implementation, Envoy-based |
| Istio | istio.io/gateway-controller | Service mesh integration |
| Cilium | io.cilium/gateway-controller | eBPF-powered, high performance |
| NGINX Gateway Fabric | gateway.nginx.org/nginx-gateway-controller | NGINX-based, F5 supported |
Next: Lesson 12 — NetworkPolicies