flux-graph is a simple tool that generates a static SVG graph representing the resources managed by Flux Kustomizations and HelmReleases in your Kubernetes cluster managed by Flux GitOps.
Understanding the relationships between Kubernetes resources managed by Flux can be challenging.
flux-graph provides a visual representation of the dependencies between these resources, helping you to:
- Easily see the structure and dependencies.
- Quickly understand resource relationships.
- Improve overall visibility into your cluster's deployment heirarchy.
flux-graph works by:
- Accepts the YAML output of
flux tree ks flux-system -o yamleither from STDIN or from a YAML file. - Processes YAML data obtained to create a graph of the relationships between the Flux Kustomizations and child resources.
- Generates a
.svgfile representing the graph structure of the various Flux and Kubernetes resources. - NEW! Serves the SVG file in a local web server using an SVG Image Viewer with zooming and panning capabilities for easier viewing.
- A Kubernetes cluster managed by Flux GitOps.
kubectlconfigured to access your cluster.fluxgo(only if building from source).
Run the following command to easily install the binary:
curl -s https://raw.githubusercontent.com/rishinair11/flux-graph/main/install.sh | sudo bashTo specify a version to install, set FLUX_GRAPH_VERSION to your preffered version:
curl -s https://raw.githubusercontent.com/rishinair11/flux-graph/main/install.sh | FLUX_GRAPH_VERSION=0.4.0 sudo bashgit clone https://github.com/rishinair11/flux-graph.git
cd flux-graphmake$ flux-graph -h
Processes a Flux Kustomization tree and generates a graph
Usage:
flux-graph [flags]
Flags:
-d, --direction string Specify direction of graph (https://graphviz.gitlab.io/docs/attrs/rankdir) (default "TB")
-f, --file string Specify input file
-h, --help help for flux-graph
-n, --no-serve Don't serve the graph on a web server
-o, --output string Specify output file (default "graph.svg")
-p, --port string Specify web server port (default "9000")Either pipe the Flux tree output directly to flux-graph:
flux tree ks flux-system -o yaml | flux-graphOr, specify a YAML file to read from:
flux tree ks flux-system -o yaml > tree.yaml
flux-graph -f tree.yamlThen visit "https://localhost:9000" to view your Flux resources in a SVG graph format.
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.