Resource Map
The Resource Map visualizes relationships between Kubernetes resources, helping you understand how your applications are connected and troubleshoot dependency issues.
Generating a Resource Map
Terminal UI
In the TUI, press m to open the resource map view. The map centers on the currently selected resource.
Web Dashboard
Click "Resource Map" in the sidebar to view the interactive graph. Click any resource in the list views to see its relationships.
CLI Command
# Open resource map in browser
kubegraf map --output browser
# Export as PNG image
kubegraf map --output png -o cluster-map.png
# Export as SVG for editing
kubegraf map --output svg -o cluster-map.svg
# Export as DOT format (for Graphviz)
kubegraf map --output dot -o cluster.dot
# Limit to specific namespace
kubegraf map -n production
# Focus on a specific resource
kubegraf map deployment/my-app
# Control relationship depth
kubegraf map --depth 3
Understanding Relationships
KubeGraf automatically detects these Kubernetes resource relationships:
Deployment → ReplicaSet
Deployments manage ReplicaSets for rolling updates
ReplicaSet → Pod
ReplicaSets create and manage Pods
Service → Pod
Services route traffic to Pods via label selectors
Ingress → Service
Ingresses route external traffic to Services
Pod → ConfigMap
Pods mount ConfigMaps as volumes or environment variables
Pod → Secret
Pods reference Secrets for sensitive configuration
Pod → PVC
Pods mount PersistentVolumeClaims for storage
Pod → ServiceAccount
Pods use ServiceAccounts for API access
PVC → PV
PersistentVolumeClaims bind to PersistentVolumes
PVC → StorageClass
PVCs request storage from StorageClasses
Pod → Node
Pods are scheduled on Nodes
HPA → Deployment
HorizontalPodAutoscalers scale Deployments
Interactive Controls
Web Dashboard
| Action | Control |
|---|---|
| Pan | Click and drag background |
| Zoom | Mouse wheel / pinch |
| Select node | Click on node |
| View details | Double-click node |
| Reset view | Press R or click "Reset" button |
| Fit to screen | Press F or click "Fit" button |
Terminal UI
| Key | Action |
|---|---|
| hjkl | Pan left/down/up/right |
| + / - | Zoom in/out |
| Tab | Cycle through nodes |
| Enter | View selected resource |
| r | Reset view |
| q | Exit map view |
Layout Options
Choose the layout that best suits your cluster structure:
| Layout | Best For |
|---|---|
force | General purpose, auto-arranges nodes to minimize overlaps |
hierarchical | Shows deployment hierarchy (Deployment → ReplicaSet → Pod) |
circular | Places nodes in a circle, good for seeing all connections |
grid | Organizes by resource type in columns |
# Use hierarchical layout
kubegraf map --layout hierarchical
# In config file
resourceMap:
defaultLayout: "hierarchical"
Filtering
Focus on specific resources or relationships:
# Show only specific resource types
kubegraf map --resources pods,services,deployments
# Exclude resource types
kubegraf map --exclude secrets,configmaps
# Filter by label
kubegraf map --selector app=frontend
# Show only unhealthy resources
kubegraf map --status unhealthy
Visual Indicators
The resource map uses visual cues to convey information:
- Node colors indicate resource types (blue for Deployments, green for Services, etc.)
- Node borders show status (green = healthy, yellow = warning, red = error)
- Edge thickness represents traffic volume (with metrics enabled)
- Edge style - solid for direct ownership, dashed for references
- Node size can represent replica count or resource usage
Export Options
| Format | Description | Use Case |
|---|---|---|
browser | Opens interactive map in browser | Exploration |
png | High-resolution image | Documentation, presentations |
svg | Scalable vector graphic | Editing, embedding |
dot | Graphviz DOT format | Custom rendering |
json | Graph data as JSON | Custom tooling |
Tip: For large clusters, use --depth 1 to show only direct relationships, reducing visual complexity.
Configuration
# config.yaml
resourceMap:
defaultLayout: "force"
defaultDepth: 2
showLabels: true
# Node colors by resource type
colors:
deployment: "#326ce5"
service: "#00d4aa"
pod: "#8b5cf6"
configmap: "#f59e0b"
secret: "#ef4444"
# Exclude from map by default
excludeResources:
- endpoints
- events