Convert Kubernetes YAML into an architecture diagram.
The whole topology is in the YAML, expressed as label matches spread across forty files.
Selectors resolved into edges
The link between a Service and its pods is a label match, and label matches are exactly what humans misread: a selector matching nothing looks identical to one matching correctly. Resolving them and drawing the result makes an orphaned Service obvious immediately, which turns this from documentation into debugging.
Stateful separated from stateless
StatefulSets with volume claims land in the data tier rather than beside Deployments. That single distinction answers the question people most often bring to a cluster diagram, which is what can be restarted freely and what cannot.
Render templates first
A Helm chart full of unresolved values produces a diagram of the template rather than of the deployment. Rendering with your values first is the difference between a picture of the chart and a picture of the environment.
Fidelity
| Comes through | Does not | |
|---|---|---|
| Deployments, StatefulSets, DaemonSets | Components | |
| Services | Edges, resolved through selectors | |
| Ingress and Gateway | Edge tier entry points | |
| PVCs | Data tier attachment | |
| ConfigMap and Secret refs | Dependency edges | Secret values, obviously |
| Namespaces | Sections | |
| NetworkPolicy | Noted | Does not constrain drawn edges |
| Live cluster state | It reads files, not a cluster |
The prompt
Questions
Does it need cluster access?
No kubeconfig and no credentials. It reads YAML, so it works against clusters you cannot reach.
Helm?
Yes, from rendered output.
Should I include system namespaces?
Usually not. The result is dominated by components you did not write and nobody reads it twice.
Related
- Convert Excalidraw to SVGA small utility, published because it solved a real problem here and the usual approach needs a DOM and about 1.4 MB of dependencies.
- Convert Mermaid to an Architecture DiagramMermaid gives you the graph. What it cannot give you is tiers, icons, and a layout that survives the diagram growing.
- Convert Code to a DiagramThe general case: point it at code and get a diagram of what is there rather than what you remember building.
- Convert a Diagram into CodeThe direction almost nothing else does: the diagram stops being documentation and becomes the instruction.
Last updated