Reference kix helpers
httpRoute.fromPaths
Build one Gateway API HTTPRoute with a separate backend rule for each path.
kix.httpRoute.fromPaths returns an unsealed Gateway API HTTPRoute
definition. Build it with scope.mkCR from a CRD reference for HTTPRoute,
which adds the instance namespace, labels, validation, and dependency
metadata. The HTTPRoute CRD comes with the Gateway API implementation, so the
package declares it with scope.mkCRDRef; without that dependency the
cluster build refuses the route (cross-resource check 21).
routeCrd = scope.mkCRDRef { group = "gateway.networking.k8s.io"; kind = "HTTPRoute"; plural = "httproutes"; version = "v1";};
route = scope.mkCR self.routeCrd (kix.httpRoute.fromPaths { name = scope.instanceName; host = "app.example.com"; parentRef = gateway.out.gatewayRef; paths = [ { path = "/api"; svc = self.apiService; port = 8080; } { path = "/"; pathType = "Exact"; svc = self.frontendService; } ];});Arguments
Section titled “Arguments”| Argument | Default | Meaning |
|---|---|---|
name | required | HTTPRoute name. |
host | required | The single entry written to spec.hostnames. |
parentRef | required | Gateway reference with name and optional namespace. |
paths | required | List of backend path records described below. |
timeouts | null | Gateway API rule timeouts, copied to every generated rule. |
Each paths entry accepts:
| Field | Default | Meaning |
|---|---|---|
path | required | HTTP path value. |
svc | required | Kix Service resource used for the backend name and dependency. |
port | svc.out.port | Numeric backend Service port. Required when the Service exports no out.port. |
pathType | "Prefix" | Prefix or PathPrefix becomes Gateway API PathPrefix; Exact remains Exact. Other values are evaluation errors. |
The helper writes one HTTPRoute rule per path. Gateway API determines rule precedence, so list order does not control which matching rule wins.
kix.expose { paths = ...; } uses this helper when the package receives a
Gateway provider, and adds the CRD reference as the part <partName>Crd
(routeCrd by default). Use the helper directly when a package needs an
HTTPRoute outside the standard exposure interface.