Visualize resource dependencies
Visualize the relationship and dependencies for all your kgateway and Kubernetes Gateway API resources in a DOT Graph.
About DOT Graphs
A DOT graph is a plain text graph description language that is primarily used with Graphviz. Graphviz is an open source graph visualization software to represent structural information and networks as diagrams, such as flowcharts, dependency trees, and state machines.
The kgwctl CLI has built-in support for generating DOT graphs to show the dependencies and relationships of kgateway and Kubernetes Gateway API resources.
Before you begin
-
Follow the Get started guide to install kgateway.
-
Follow the Sample app guide to create a gateway proxy with an HTTP listener and deploy the httpbin sample app.
-
Get the external address of the gateway and save it in an environment variable.
export INGRESS_GW_ADDRESS=$(kubectl get svc -n kgateway-system http -o jsonpath="{.status.loadBalancer.ingress[0]['hostname','ip']}") echo $INGRESS_GW_ADDRESS
kubectl port-forward deployment/http -n kgateway-system 8080:8080
Visualize your resources
-
Generate a graph for a particular resource in your cluster. The following command generates a graph for the http Gateway that you created in before you begin
kgwctl get gateway http -n kgateway-system -o graph > output.graph
-
Open the Graphviz online playground.
-
Copy and paste the output of
output.graph
into the Graphviz online playground. The tool automatically generates the DOT graph for you.