gateway-api-lens

module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2023 License: Apache-2.0

README

Gateway API Lens

Gateway API Lens is a tool to visualize Kubernetes Gateway API configuration.

The following example from gateway-API will be used to illustrate the different outputs formats generated:

Gateway-API example

Additionally, Gateway Blueprint and attached policies from the Bifrost Gateway Controller will be used.

See Makefile.local for how to setup the example usecase.

Graphviz Graph Output

To output the Gateway-API configuration on Graphviz dot format, with the path spec.values.default from the GatewayClass parameter resource also shown:

$ gateway-api-lens -o graph --gwc-param-path spec.values  |  dot -Tsvg > output.svg

It is also possible to run the tool in a web-server mode, where the graph will available through HTTP on the specified port:

$ gateway-api-lens -o graph -l 8080

In the example, policies (see GEP-713) are attached to both GatewayClass and Gateway resources as well as the namespace of the Gateway (such indirect attachments are shown with a dashed arrow):

Example Graphviz output

Policies in Table Format

$ gateway-api-lens -o policy

NAMESPACE                         POLICY                                                 TARGET                                   DEFAULT OVERRIDE
bifrost-gateway-controller-system GatewayClassConfig/aws-alb-crossplane-internal-dev-env GatewayClass/aws-alb-crossplane-internal No      Yes
bifrost-gateway-controller-system GatewayClassConfig/aws-alb-crossplane-public-dev-env   GatewayClass/aws-alb-crossplane-public   No      Yes
foo-infra                         GatewayClassConfig/foo-infra-tenant-defaults           Namespace/foo-infra                      No      Yes
foo-infra                         GatewayConfig/foo-gateway-custom-acl                   Gateway/foo-infra/foo-gateway            No      Yes

Hierarchy Format

$ gateway-api-lens -o hierarchy

RESOURCE                                 CONFIGURATION
GatewayClass aws-alb-crossplane-internal
GatewayClass aws-alb-crossplane-public
 └─ Gateway foo-infra/foo-gateway        web:HTTP/80 foo.example.com
     ├─ HTTPRoute foo-site/foo-site
     │   ├─ match                        PathPrefix /site
     │   └─ backends                     Service/foo-site/foo-site:80@1
     └─ HTTPRoute foo-store/foo-store
         ├─ match                        PathPrefix /store
         └─ backends                     Service/foo-store-v1:80@90 Service/foo-store-v2:80@10

Route-tree Format

$ gateway-api-lens -o route-tree

HOSTNAME/MATCH         BACKEND
foo.example.com
  ├─ PathPrefix /site  Service/foo-site/foo-site:80@1
  └─ PathPrefix /store Service/foo-store-v1:80@90 Service/foo-store-v2:80@10

Directories

Path Synopsis
cmd
pkg
version
Package version provides a place to store version information, which can be set at build time.
Package version provides a place to store version information, which can be set at build time.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL