Closed jjaferson closed 2 years ago
Adds integration to Gateway API to generate HTTPRoute
Command to generate Gateway API routing integration from Open API specification:
kuadrantctl generate gatewayapi httproute
Example:
--- openapi: "3.0.0" info: title: "Pet Store API" version: "1.0.0" servers: - url: https://toplevel.example.io/v1 paths: /cat: get: parameters: - in: header name: X-username schema: type: string operationId: "getCat" responses: 405: description: "invalid input" post: operationId: "postCat" responses: 405: description: "invalid input" /dog: get: operationId: "getDog" responses: 405: description: "invalid input"
Running the defined parameters below --namespace myns, --oas ./examples/oas3/petstore.yaml, --public-host www.kuadrant.io, --service-name myservice and --gateway kuadrant-gateway
--namespace myns
--oas ./examples/oas3/petstore.yaml
--public-host www.kuadrant.io
--service-name myservice
--gateway kuadrant-gateway
kuadrantctl generate gatewayapi httproute --namespace myns --oas ./examples/oas3/petstore.yaml --public-host www.kuadrant.io --service-name myservice --gateway kuadrant-gateway
The CLI will generate the result below:
{ "kind":"HTTPRoute", "apiVersion":"gateway.networking.k8s.io/v1alpha2", "metadata":{ "creationTimestamp":null }, "spec":{ "hostnames":[ "www.kuadrant.io" ], "rules":[ { "matches":[ { "path":{ "type":"PathPrefix", "value":"/cat" }, "headers":[ { "type":"Exact", "name":"X-username", "value":"" } ], "method":"GET" }, { "path":{ "type":"PathPrefix", "value":"/cat" }, "method":"POST" }, { "path":{ "type":"PathPrefix", "value":"/dog" }, "method":"GET" } ], "backendRefs":[ { "name":"myservice.myns.svc", "port":80 } ] } ] }, "status":{ "parents":null } }
Missing some (basic) doc at README.md and /doc/generate-gatewayapi-httproute.md
/doc/generate-gatewayapi-httproute.md
Adds integration to Gateway API to generate HTTPRoute
Command to generate Gateway API routing integration from Open API specification:
Example:
Running the defined parameters below
--namespace myns
,--oas ./examples/oas3/petstore.yaml
,--public-host www.kuadrant.io
,--service-name myservice
and--gateway kuadrant-gateway
The CLI will generate the result below: