Gateway API models.
Install with npm.
npm install @kubernetes-models/gateway-api
import { HTTPRoute } from "@kubernetes-models/gateway-api/gateway.networking.k8s.io/v1/HTTPRoute";
// Create a new HTTPRoute
const route = new HTTPRoute({
metadata: {
name: "http-route"
},
spec: {
parentRefs: [
{
kind: "Gateway",
name: "foo-gateway"
}
],
rules: [
{
backendRefs: [{ name: "foo-svc", port: 8080 }]
}
]
}
});
// Validate against JSON schema
route.validate();
MIT