Gateway API
As the notes app grows, the platform team wants to own the public entry point while each app team controls its own routes. Ingress puts everything in one object and leaves advanced features to vendor-specific annotations. The Gateway API is the newer, role-based design for the same job.
The rule
GatewayClass says what kind, Gateway says where, Routes say which way.
The Gateway API splits traffic entry into objects owned by different people:
| Object | Who owns it | What it says |
|---|---|---|
| GatewayClass | Infrastructure provider | Which implementation handles gateways, e.g. a cloud load balancer or Envoy |
| Gateway | Cluster operator | Listeners: which ports, protocols, host names and certificates are open |
| HTTPRoute | App team | Which requests go to which Services |
The notes team only writes the route:
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: notes
namespace: notes
spec:
parentRefs:
- name: public-gateway
namespace: infra
hostnames:
- notes.example.com
rules:
- matches:
- path:
type: PathPrefix
value: /
backendRefs:
- name: notes-web
port: 80
weight: 90
- name: notes-web-canary
port: 80
weight: 10The parentRefs attach the route to a Gateway someone else runs. The two weight values send 90% of traffic to the stable version and 10% to a canary — a feature that needed controller-specific annotations with Ingress, but is part of the standard here. Routes can also match on headers and query parameters.
Like Ingress, the Gateway API needs an implementation installed in the cluster, and the Gateway API's resource definitions (CRDs) must be present. It reached general availability (v1.0) in 2023 and is where new features are being added; Ingress remains supported and widely used.
The shortcut
Read a Gateway setup from the top down, by owner: which class (provider) → which Gateway and listener (operator) → which route and backends (app team). Every problem lives at exactly one level.
GatewayClass
kubectl get gatewayclassshows the classAccepted. The implementation is installed.
Drills
Answer fast — trust the rule.
Which Gateway API object does an app team usually write?
Which object defines the listening ports, protocols and certificates?
Two backendRefs have weights 90 and 10. What happens?
What is a key advantage of the Gateway API over Ingress?
Remember
- GatewayClass says what kind, Gateway says where, Routes say which way.
- Debug top-down by owner: class → Gateway → route.
- Trap: like Ingress, nothing works without an installed implementation.
