Configure Kubernetes Gateway API with a GatewayClass, Gateway, and HTTPRoute for path-based routing with header-based traffic splitting across two backend services
Install a Gateway API-compatible controller such as Envoy Gateway or Contour and verify the GatewayClass is accepted by the controller by checking its status conditions
Define a Gateway manifest referencing the GatewayClass and specifying listeners with protocol and port, and optionally attach TLS certificate references for HTTPS listeners
Author HTTPRoute manifests in the application namespace with parentRefs pointing to the Gateway, and define rules with path match criteria and backendRefs listing the two Services with weights for traffic splitting
Add header-based routing rules in a separate HTTPRoute rule using headers matches to route requests with specific header values to a canary backend independently of the weight-based split
Apply the resources and verify routing behavior by sending test requests with and without the canary header and confirming traffic distribution matches the configured weights and header rules
Known gotchas
Gateway API controllers vary in which features they support from the standard; a feature like header-based splitting may be classified as Extended conformance and silently ignored by controllers that only implement Core features — always check the controller's conformance report
HTTPRoute parentRefs must include the correct sectionName if the Gateway has multiple listeners; omitting sectionName can attach the route to all listeners including unintended ones
Gateway API uses a reference grant mechanism for cross-namespace references; a backendRef in an HTTPRoute pointing to a Service in a different namespace requires a ReferenceGrant object in the target namespace or the route status will show an error
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp