The relationship command manages relationships between components, defining how infrastructure components interact and depend on each other.
Synopsis
mesheryctl relationship [subcommand] [flags]
Subcommands
list - List all available relationships
view - View relationship details
search - Search for relationships
generate - Generate relationship documentation
Global Flags
Display total count of relationships. Short form: -c
list
List all available component relationships.
Usage
mesheryctl relationship list [flags]
Flags
Page number for pagination
Number of relationships per page
Display only the count of relationships
Examples
List Relationships
Pagination
# List all relationships
mesheryctl relationship list
# Get relationship count
mesheryctl relationship list --count
Sample Output
KIND TYPE SUBTYPE MODEL
Pod-Service edge network Kubernetes
Deployment-Pod hierarchical parent Kubernetes
VirtualService edge traffic Istio
ConfigMap-Pod edge mount Kubernetes
Total: 450 relationships
view
Display detailed information about a relationship.
Usage
mesheryctl relationship view [relationship-name] [flags]
Flags
Output format: yaml, json. Short form: -o
Examples
View Relationship
Filter by Model
# View relationship in YAML
mesheryctl relationship view Pod-Service
# View in JSON format
mesheryctl relationship view Deployment-Pod -o json
Sample Output
kind : Pod-Service
type : edge
subtype : network
model :
name : Kubernetes
version : v1.28.0
selectors :
- from :
kind : Pod
match :
labels : true
to :
kind : Service
match :
selector : true
metadata :
description : Service routes traffic to Pods based on label selectors
published : true
search
Search for relationships by kind, type, subtype, or model.
Usage
mesheryctl relationship search [flags]
Flags
Filter by relationship kind
Filter by relationship type (edge, hierarchical, sibling)
Filter by relationship subtype
Examples
Search by Type
Search by Model
Advanced Search
# Search edge relationships
mesheryctl relationship search --type edge
# Search hierarchical relationships
mesheryctl relationship search --type hierarchical
Sample Output
KIND TYPE SUBTYPE MODEL
Pod-Service edge network Kubernetes
Pod-ConfigMap edge mount Kubernetes
Pod-Secret edge mount Kubernetes
Found: 3 relationships
generate
Generate relationship documentation.
Usage
mesheryctl relationship generate [flags]
Flags
Output directory for generated documentation. Short form: -o
Generate documentation for specific model
Examples
# Generate all relationship documentation
mesheryctl relationship generate -o ./docs
# Generate for specific model
mesheryctl relationship generate --model Kubernetes -o ./k8s-docs
Count Relationships
Display the total number of registered relationships.
Usage
mesheryctl relationship --count
Example Output
Relationship Types
Meshery supports several relationship types:
Edge Relationships
Define connections between components:
network - Network connectivity (Service → Pod)
mount - Volume or config mounting (ConfigMap → Pod)
traffic - Traffic routing (VirtualService → Service)
firewall - Network policy (NetworkPolicy → Pod)
permission - RBAC relationships (Role → ServiceAccount)
Hierarchical Relationships
Define parent-child relationships:
parent - Owner reference (Deployment → Pod)
inventory - Resource grouping (Namespace → Resources)
Sibling Relationships
Define peer relationships:
binding - Resource binding (PersistentVolumeClaim ↔ PersistentVolume)
Relationship Properties
Relationships include:
Identifiers
Kind - Unique relationship identifier
Type - Relationship category (edge, hierarchical, sibling)
Subtype - Specific relationship purpose
Selectors
From - Source component definition
To - Target component definition
Match - Matching criteria (labels, annotations, etc.)
Model - Parent model
Version - Relationship version
Description - Relationship purpose
Published - Registry status
Use Cases
Understand Component Dependencies
# Find all Pod relationships
mesheryctl relationship search --kind Pod
# View specific relationship details
mesheryctl relationship view Pod-Service
Explore Service Mesh Relationships
# List Istio relationships
mesheryctl relationship search --model Istio
# View traffic management relationships
mesheryctl relationship search --subtype traffic --model Istio
Document Infrastructure Patterns
# Generate relationship documentation
mesheryctl relationship generate -o ./infrastructure-docs
# Generate for specific model
mesheryctl relationship generate --model Kubernetes -o ./k8s-patterns
Relationship Examples
Pod to Service (Edge/Network)
kind : Pod-Service
type : edge
subtype : network
selectors :
- from :
kind : Pod
match :
labels :
app : my-app
to :
kind : Service
match :
selector :
app : my-app
metadata :
description : Service selects and routes traffic to Pods with matching labels
Deployment to Pod (Hierarchical/Parent)
kind : Deployment-Pod
type : hierarchical
subtype : parent
selectors :
- from :
kind : Deployment
to :
kind : Pod
match :
owner : true
metadata :
description : Deployment manages the lifecycle of Pods via ReplicaSet
ConfigMap to Pod (Edge/Mount)
kind : ConfigMap-Pod
type : edge
subtype : mount
selectors :
- from :
kind : ConfigMap
to :
kind : Pod
match :
volumes : true
metadata :
description : ConfigMap data is mounted into Pod as files or environment variables
Troubleshooting
Relationship Not Found
# List all available relationships
mesheryctl relationship list
# Search with filters
mesheryctl relationship search --model MyModel
# Check specific relationship kind
mesheryctl relationship search --kind MyRelationship
Understanding Relationship Types
# List all edge relationships
mesheryctl relationship search --type edge
# List all hierarchical relationships
mesheryctl relationship search --type hierarchical
# View relationship details
mesheryctl relationship view RelationshipName -o yaml
Filter Results
# Combine multiple filters
mesheryctl relationship search --type edge --model Kubernetes
# Use pagination for large result sets
mesheryctl relationship list --page-size 100
See Also