Skip to content

Gateway API — Next-Generation Network API

This page shows how to use the Gateway API in Kuboard to create your first HTTP gateway and complete cross-namespace reference authorization. It is intended for cluster administrators and application developers.

The Gateway API is the official next-generation traffic routing API from Kubernetes, designed to gradually replace Ingress: it splits Ingress's "one object describing both ingress and routing" approach into three tiers — GatewayClass → Gateway → Route — so cluster operators and application developers each manage their own concerns without stepping on each other's toes.

AspectIngressGateway API
Object modelA single object carries both "ingress + routing"Split into three tiers: GatewayClass / Gateway / Route
Division of responsibilitiesOperators and application developers share the same objectOperators manage GatewayClass and Gateway; developers only manage Routes
Protocol supportMostly HTTP / HTTPSHTTP, HTTPS, TLS, TCP, UDP, gRPC
Cross-namespaceLimited supportExplicitly allowed through ReferenceGrant (reference authorization)

Relationship with Ingress

The two can coexist: existing Ingress objects are unaffected, and for new ingress the Gateway API is recommended. Traditional Ingress is covered in Service & Ingress, and network isolation in NetworkPolicy.

Prerequisites

  1. Install the Gateway API CRDs (CustomResourceDefinition):
sh
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.2.0/standard-install.yaml
  1. Install a gateway controller (choose one; feature support differs slightly between implementations; fill in its preset value as the "Controller Name" when creating a GatewayClass):
ControllerPreset controller name
Istioistio.io/gateway-controller
Envoy Gatewaygateway.envoyproxy.io/gateway-controller
Ciliumio.cilium/gateway-controller
NGINX Gateway Fabricgateway.nginx.org/nginx-gateway-controller
ingress-nginxk8s.io/ingress-nginx (requires starting with the --enable-gateway-api flag)

No "Gateway" menu found in Kuboard

  1. The menu path is Services & Networking → Gateway. If the cluster does not have the Gateway API CRDs installed, the menu still appears but the list page is empty;
  2. When you click Create (+), Kuboard first probes resource availability. If the probe fails, a "Resource Unavailable" dialog pops up, offering a one-click copyable install command (the standard-install.yaml above), a component description, and links to the official documentation;
  3. After installation, refresh the page and everything works as expected.

Create Your First HTTP Gateway

Take the most common scenario as an example: route example.com HTTP traffic through a gateway to Service my-web in namespace web. The whole process has four steps. GatewayClass and Gateway are usually created by the cluster administrator; application developers mainly create Routes and attach them to existing Gateways.

Step 1: Create a GatewayClass

  1. Go to Services & Networking → Gateway → GatewayClass, and click Create (+);
  2. Fill in:
FieldDescriptionExample
NameThe GatewayClass nameexample-gateway-class
Controller NameRequired. Select a mainstream controller from the dropdown, or enter it manuallyistio.io/gateway-controller
DescriptionOptional, up to 256 characters
  1. Click Save → confirm in the Preview YAML dialog → after submitting, you are redirected to the details page. The GatewayClass appears in the list; if the Status on the details page shows the controller has taken over, it succeeded. (A GatewayClass is a cluster-scoped resource, so no namespace needs to be selected when creating it.)

Advanced option: parameter reference

When the controller needs an additional configuration object (e.g. a configuration-parameter CRD), expand "Enable Parameter Reference (Advanced)" in the form and fill in the Group / Kind / Name. Most scenarios don't need it; leave it off.

Step 2: Create a Gateway

  1. Go to Services & Networking → Gateway → Gateway, and click Create (+), then fill in the Name and the GatewayClass Name (the name from Step 1);
  2. In the Listeners table, click Add Listener and configure at least one:
FieldDescriptionExample
NameListener namehttp-listener
Port1 - 6553580
ProtocolHTTP / HTTPS / TCP / TLS / UDPHTTP
HostnameOptional; when set, this listener only accepts traffic matching this hostnameexample.com
Allowed RoutesWhich namespaces' Routes may attach: Same (this namespace only) / All (all) / Selector (select by label)Same
  1. Address is optional: if left empty, the controller assigns one automatically and you can view the actual address on the details page after creation. Save and confirm the preview YAML. If the Status on the details page shows the controller has taken over this Gateway, it succeeded; if not, see the troubleshooting at the end.

Step 3: Create an HTTPRoute

  1. Go to Services & Networking → Gateway → HTTP Route, and click Create (+), then fill in the Name (e.g. my-web-route);
  2. In Parent Refs, click Add Parent Ref to point to the Gateway from Step 2:
FieldDescription
NameRequired. The Gateway name
NamespaceThe namespace of the Gateway (optional if it is the same namespace as the Route)
Section Name / PortOptional; precisely specify a listener to attach to
  1. Enter example.com in Hostnames (press Enter to confirm; if left empty, it matches all hostnames of the attached Gateway); in Rules, click Add Rule, then select the rule and configure Backend Refs in the "Selected Rules" area below:
FieldDescriptionExample
TypeThe backend resource type, default ServiceService
NameSelect the Service in the namespacemy-web
NamespaceThe namespace of the Service; cross-namespace requires a ReferenceGrant (see below)web
PortThe Service port80
WeightDistribute traffic by weight across multiple backends (default 1)1
  1. Save and confirm (result: the HTTPRoute appears in the list, and the Attached Gateway tab on the details page shows which Gateway it is attached to). Matches (path / header / query parameter / method) and filters (URL rewrite, header modification) are advanced capabilities: the form only shows the counts, and the details need to be edited in YAML. Most scenarios only need to configure hostname + backend refs.

Step 4: Verify

  1. HTTPRoute details → Status: if the controller has accepted the rules, the rules are in effect; Gateway details → Attached Routes: you can see HTTPRoute / my-web-route;
  2. Gateway details → Address: confirm the gateway's external address (assigned by the controller);
  3. Verify traffic with curl:
sh
curl -H "Host: example.com" http://<gateway-address>/

Seeing the my-web response means it succeeded.

ReferenceGrant — Cross-Namespace Reference Authorization

The Gateway API's default policy is: namespaces are trust boundaries. A Route can only reference objects in its own namespace; cross-namespace references are always rejected unless the namespace of the referenced object contains a matching ReferenceGrant. Two typical scenarios require creating one: a Route forwarding to a Service in another namespace, or a Route referencing a Gateway in another namespace (e.g. the gateway-system namespace where the unified gateway lives).

Go to Services & Networking → Gateway → Reference Grant (ReferenceGrant), and click Create (+), then fill in the Name (e.g. allow-web-to-my-web) and configure the two tables below: From declares "who" is allowed to reference, and To declares "what may be referenced".

FieldDescriptionExample
GroupThe group of the referencing resourcegateway.networking.k8s.io
KindThe kind of the referencing resourceHTTPRoute
NamespaceThe namespace of the referencing resourceweb
FieldDescriptionExample
GroupThe group of the referenced resource (leave empty for the core group)""
KindThe kind of the referenced resourceService
NameOptional; limit to a specific object; if empty, all objects in the namespacemy-web

Which namespace should the ReferenceGrant be in

A ReferenceGrant must be created in the namespace where the referenced object lives. For example, if a Route in namespace A references a Service in namespace B, create it in namespace B, with the From pointing to the HTTPRoute in A and the To pointing to the Service in B.

Route Types by Use Case

TypeProcessing layerHostnameRule capabilitiesUse cases
HTTPRouteL7YesPath / header / query parameter / method matching, filters, weighted multi-backendWebsites, REST services, domain-based traffic splitting
GRPCRouteL7YesMethod-based matching, filtersgRPC microservices
TLSRouteL4Yes (split by SNI)Backend forwarding onlyTLS termination (HTTPS origin), routing by certificate domain
TCPRouteL4NoBackend forwarding onlyTCP services such as databases and message queues
UDPRouteL4NoBackend forwarding onlyUDP services such as DNS and log collection
  • Fine-grained forwarding by domain / path / header → HTTPRoute; gRPC traffic → GRPCRoute;
  • Only forward TLS traffic by port + domain (SNI) → TLSRoute; raw L4 traffic → TCPRoute / UDPRoute (no hostname; rules only contain backend refs).

Troubleshooting: Where to Look When a Route Does Not Take Effect

When a route does not take effect, check the status first, then the events:

  1. Gateway details → Status and Route details → Status: look for abnormal rows (Failed / Rejected); "Reason" and "Message" explain the cause directly. If the Route shows "the controller has not reported status", the controller has not processed it;
  2. Verify the attachments: Route details → Attached Gateway to confirm it points to the correct Gateway; Gateway details → Attached Routes to confirm the Route is actually in the list.

Quick reference of common causes:

SymptomCommon cause
Gateway status empty / controller not taken overThe gateway controller is not installed or not started; first check the "Prerequisites"
Route status abnormal (rejected)Invalid listener configuration (port conflict, unsupported protocol), GatewayClass name does not exist
Route cannot attach to GatewayWrong name / namespace in the parent refs; listener protocol does not match the Route type; rejected by the listener's "Allowed Routes"
Cross-namespace forwarding failsMissing ReferenceGrant (create it in the namespace of the referenced Service)
A hostname is set but access returns 404The Route's hostname does not match the listener's hostname; or the requested Host is not in the Route's hostname list
Backend connection failsWrong backend ref port, Service does not exist, weight is 0

How to view events

When status information is insufficient, open the Events tab of the corresponding object to check controller errors. In Kuboard, the "Events" entry is available in both the object list and the details page.