You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+44Lines changed: 44 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@ A Python library for rendering Helm charts and Kubernetes resources with optiona
11
11
-`KubernetesResource` class for raw Kubernetes resources (no Helm required)
12
12
-`TemplateRegistry` for managing multiple templates (charts and resources)
13
13
- Command-line interface (CLI) for rendering and applying manifests
14
+
- Resource visualization with Graphviz DOT diagrams showing resource relationships
14
15
- Automatic Docker image build and load steps (executed sequentially during template registration)
15
16
- Git operations for manifest repository management
16
17
- Docker image build and push utilities with custom Dockerfile support
@@ -363,6 +364,49 @@ for template_class in templates:
363
364
364
365
**For HelmChart:** Renders to `manifests/{chart-name}/{chart-name}-manifests.yaml`, writes extra manifests to `manifests/{chart-name}/`, and generates ArgoCD Application to `manifests/apps/{chart-name}-application.yaml` (if enabled).
365
366
367
+
### Visualizing Resource Relationships
368
+
369
+
Generate Graphviz DOT diagrams to visualize Kubernetes resources and their relationships:
1. Renders templates to generate manifests (build steps are automatically skipped)
387
+
2. Analyzes rendered manifests to detect relationships (ConfigMap references, Service selectors, network connections, etc.)
388
+
3. Generates a Graphviz DOT diagram showing resource hierarchy and relationships
389
+
4. Outputs to a file or stdout
390
+
391
+
**Rendering the diagram:**
392
+
393
+
After generating the DOT file, render it to an image using Graphviz:
394
+
395
+
```bash
396
+
# Generate PNG image
397
+
dot -Tpng diagram.dot -o diagram.png
398
+
399
+
# Generate SVG image
400
+
dot -Tsvg diagram.dot -o diagram.svg
401
+
```
402
+
403
+
**Visualization features:**
404
+
- Shows resources grouped by namespace
405
+
- Displays relationships between resources (uses, selects, connects-to)
406
+
- Includes connection addresses (e.g., database URLs from ConfigMaps)
407
+
- Filters to only show resources from templates in your `kubeman.py` file
408
+
- Optionally includes CustomResourceDefinitions (hidden by default)
409
+
366
410
**For KubernetesResource:** Writes each manifest to `manifests/{name}/{manifest-name}-{kind}.yaml` and generates ArgoCD Application to `manifests/apps/{name}-application.yaml` (if enabled).
0 commit comments