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

ActionControl
PanClick and drag background
ZoomMouse wheel / pinch
Select nodeClick on node
View detailsDouble-click node
Reset viewPress R or click "Reset" button
Fit to screenPress F or click "Fit" button

Terminal UI

KeyAction
hjklPan left/down/up/right
+ / -Zoom in/out
TabCycle through nodes
EnterView selected resource
rReset view
qExit map view

Layout Options

Choose the layout that best suits your cluster structure:

LayoutBest For
forceGeneral purpose, auto-arranges nodes to minimize overlaps
hierarchicalShows deployment hierarchy (Deployment → ReplicaSet → Pod)
circularPlaces nodes in a circle, good for seeing all connections
gridOrganizes 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:

Export Options

FormatDescriptionUse Case
browserOpens interactive map in browserExploration
pngHigh-resolution imageDocumentation, presentations
svgScalable vector graphicEditing, embedding
dotGraphviz DOT formatCustom rendering
jsonGraph data as JSONCustom 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