fluxcd / flux2

Open and extensible continuous delivery solution for Kubernetes. Powered by GitOps Toolkit.
https://fluxcd.io
Apache License 2.0
6.52k stars 602 forks source link

Generate a dependency graph of resources #4685

Open bmm-alc opened 7 months ago

bmm-alc commented 7 months ago

Describe the bug

That would ge useful to have a command like flux dot <type>/<resource> to generate a dot compatible output, in order to see the dependency graph.

Steps to reproduce

nothing to provide here

Expected behavior

a dot file in stdout or a file I can pass to dot.

Screenshots and recordings

No response

OS / Distro

does not matter

Flux version

2.2.2

Flux check

not relevant

Git provider

No response

Container Registry provider

No response

Additional context

No response

Code of Conduct

stefanprodan commented 7 months ago

Is this about Flux dependsOn or something else?

bmm-alc commented 7 months ago

Is this about Flux dependsOn or something else?

Yes ! sorry to not be clear

stefanprodan commented 6 months ago

I propose we go with flux deps kustomizations --output dot

stefanprodan commented 6 months ago

Also dot should not be the default output, instead we should render the deps as text to stdout, same as flux tree does it.

bigkevmcd commented 6 months ago

I'm happy to take this one on, I've done this sort of thing before 😄

rishinair11 commented 2 months ago

I created a tool for the same here: https://github.com/rishinair11/flux-graph Would be nice to see this out of the box in Flux though :)