Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Services and Networking  ›  Capstone Project

Gateway API

Gateway API 12 minThe Gateway API splits traffic entry into GatewayClass, Gateway and route objects owned by provider, operator and app team, and standardises features such as weighted traffic splitting.

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: 10

The 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.

Why is notes.example.com not answering?Step 1 of 4
  1. GatewayClass

    kubectl get gatewayclass shows the class Accepted. The implementation is installed.

Drills

Answer fast — trust the rule.

quick drill

Which Gateway API object does an app team usually write?

quick drill

Which object defines the listening ports, protocols and certificates?

quick drill

Two backendRefs have weights 90 and 10. What happens?

quick drill

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.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainWho owns what?

Explain the roles of GatewayClass, Gateway and HTTPRoute, who typically owns each, and how the notes team would send 10% of traffic to a new version.