Lesson 30 of 70 · 9 min read · Updated
Kubernetes Gateway API Fundamentals: GatewayClass, Gateway, Routes and Status Conditions
On this page
Ingress gave Kubernetes one small object for HTTP routing: a host, a path, a backend Service. Anything beyond that (rewrites, header matching, traffic splitting, timeouts) went into controller-specific annotations, so an Ingress written for one controller rarely worked on another. The Gateway API replaces that model with a set of typed, role-oriented resources that every implementation reads the same way.
This lesson covers the fundamentals without any controller installed: what each resource is for, who owns it, how routes attach to Gateways, and how to read status. The next two lessons install a real implementation (NGINX Gateway Fabric, then Traefik), and the rest of the series goes into routing, TLS, traffic splitting and multi-tenant setups.
The running example is PedalShare, a city bike-sharing platform with a stations API, a rides API, a pricing API and a gRPC fleet telemetry service.
Technical Requirements
- Docker, kind v0.33+ and kubectl 1.34+
- The sample repository: Fcakiroglu16/dotnetacademy, branch gateway-api-fundamentals
scripts/cluster-up.sh creates a kind cluster named gateway-lab (Kubernetes v1.36), builds the PedalShare images, loads them into the nodes and installs the Gateway API CRDs. The series uses Gateway API v1.6.3, the newest version supported by both NGINX Gateway Fabric 2.8 and Traefik 3.7 at the time of writing.
Why Ingress Was Not Enough
| Need | Ingress | Gateway API |
|---|---|---|
| Header, query or method matching | Annotations, per controller | matches in HTTPRoute |
| Weighted traffic split | Annotations or a separate CRD | weight on backendRefs |
| Path rewrite, redirects, header changes | Annotations | Built-in filters |
| Protocols other than HTTP | Not covered | GRPCRoute, TLSRoute, TCPRoute, UDPRoute |
| Shared entry point across teams | One object mixes infra and app settings | Gateway owned by ops, routes owned by teams |
| Reporting problems | Mostly controller logs | Standard status.conditions on every object |
Ingress is not removed from Kubernetes, but it is frozen: no new features are added. The community Ingress NGINX controller reached end of life in March 2026, which pushed many clusters to move to Gateway API.
Core Concepts
The three roles
The API splits ownership between three personas. Each one edits only its own resources.
- Infrastructure provider: installs an implementation and publishes a
GatewayClass. - Cluster operator: creates
Gatewayobjects, picks ports, hostnames and TLS certificates, and decides which namespaces may attach routes. - Application developer: writes
HTTPRouteorGRPCRouteobjects in their own namespace, pointing at their own Services.
RBAC follows the same split: developers can get write access to routes without being able to open a new port on the edge proxy.
GatewayClass
A cluster-scoped object that names a controller through spec.controllerName. It works like StorageClass: it describes a kind of Gateway, not a running proxy. Installing NGINX Gateway Fabric creates a class called nginx; installing Traefik creates traefik.
Gateway
A namespaced request for an entry point. It references a GatewayClass and lists listeners. Each listener has a name, a protocol (HTTP, HTTPS, TLS, TCP, UDP), a port, an optional hostname, TLS settings and allowedRoutes. When a controller accepts the Gateway, it starts (or configures) a data plane and writes the address into status.addresses.
Routes
Routes carry the actual routing rules. Each rule has matches, optional filters and backendRefs.
| Resource | Matches on | Typical use |
|---|---|---|
HTTPRoute | Host, path, headers, query, method | REST APIs, web apps |
GRPCRoute | Host, gRPC service and method, headers | gRPC services |
TLSRoute | SNI hostname (TLS passthrough) | Backends that terminate TLS themselves |
TCPRoute / UDPRoute | Listener port only | Databases, DNS, game servers |
Attachment: parentRefs and allowedRoutes
A route asks to join a Gateway through spec.parentRefs, optionally naming one listener with sectionName. The Gateway decides whether to accept it with allowedRoutes:
from: Same: routes only from the Gateway's namespace (the default)from: Selector: routes from namespaces that match a label selectorfrom: All: routes from any namespace
Both sides must agree. A route that points at a Gateway that does not allow it is rejected with NotAllowedByListeners.
ReferenceGrant and other resources
- ReferenceGrant: lets an object in one namespace reference an object in another one, for example a route in
pedalshare-ridessending traffic to a Service inpedalshare-pricing. Without it, cross-namespacebackendRefsfail withRefNotPermitted. - ListenerSet: lets teams add listeners to a shared Gateway from their own namespace (Standard since v1.5).
- BackendTLSPolicy: tells the Gateway to use TLS when it connects to a backend.
Release channels
Each release ships two bundles. Standard contains only GA resources and fields, which are covered by compatibility guarantees. Experimental adds alpha resources and fields that may still change. Install only one channel per cluster, and use Standard unless you need a specific experimental feature.
Status conditions
Every controller reports the same conditions, so the same three commands tell you what went wrong on any implementation.
| Object | Condition | Meaning when True |
|---|---|---|
| GatewayClass | Accepted | A controller owns this class |
| Gateway | Accepted | The spec is valid and the controller will implement it |
| Gateway | Programmed | The data plane is configured and has an address |
| Listener | ResolvedRefs | Certificates and other references were found |
| Route (per parent) | Accepted | The parent Gateway took the route |
| Route (per parent) | ResolvedRefs | Every backend and filter reference resolved |
Hands-On: Kubernetes Commands
Create the lab cluster and install the CRDs:
List what the CRDs added:
Check which version and channel are installed. Controllers compare this annotation with the version they support:
kubectl explain documents every field, including its support level (Core, Extended or Implementation-specific):
Step-by-Step Example
The goal is to model the PedalShare edge before choosing a controller. The manifests are in k8s/01-fundamentals.
Step 1: The GatewayClass
The class names a controller that does not exist yet, so we can see what the objects look like before anything implements them.
k8s/01-fundamentals/01-gatewayclass.yaml
Step 2: The Gateway
The platform team owns pedalshare-infra. Its Gateway exposes one HTTP listener for *.pedalshare.local and accepts routes only from namespaces labelled pedalshare.io/edge-access=true.
k8s/01-fundamentals/02-gateway.yaml
Step 3: A team's HTTPRoute
The stations team works in its own namespace, which carries the label. Its route attaches to the http listener of the shared Gateway and sends /stations to the stations-api Service.
k8s/01-fundamentals/03-httproute.yaml
Step 4: Apply and read the status
The conditions say exactly what is missing:
The HTTPRoute has no status at all. A route only gets a status.parents entry when a controller processes it. An empty status means that no controller has looked at the route, not that the route is broken.
Step 5: Validation happens in the API server
The CRDs include CEL validation rules, so some mistakes are rejected before any controller sees them. Here, a path without a leading slash is rejected:
Other errors only show up in status, because only the controller can detect them: a missing Service, a missing TLS Secret, or a listener port the implementation cannot open.
Results
| Check | Result |
|---|---|
| Gateway API v1.6.3 Standard CRDs installed | 10 resources, all served as v1 |
| GatewayClass with no controller | Accepted=Unknown, reason Pending |
| Gateway on that class | Accepted and Programmed are Unknown, no address |
| HTTPRoute attached to the Gateway | No status until a controller processes it |
Relative path in PathPrefix | Rejected by the API server's CEL validation |
Summary
- The Gateway API splits edge configuration into
GatewayClass(provider),Gateway(operator) and routes (developers), and RBAC can follow that split. - Routes attach through
parentRefs, and Gateways decide what they accept throughallowedRoutes. Cross-namespace backends need aReferenceGrant. - Install one release channel. Standard is the safe default, and the CRD annotations show which version is installed.
Accepted,ProgrammedandResolvedRefsmean the same thing on every implementation, so read status before reading logs.
In the next lesson, NGINX Gateway Fabric becomes the controller, and the same kind of Gateway gets a real NGINX data plane and an address.