Skip to main content
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

--count
boolean
default:"false"
Display total count of relationships. Short form: -c

list

List all available component relationships.

Usage

mesheryctl relationship list [flags]

Flags

--page
integer
default:"1"
Page number for pagination
--page-size
integer
default:"25"
Number of relationships per page
--count
boolean
default:"false"
Display only the count of relationships

Examples

# 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
string
default:"yaml"
Output format: yaml, json. Short form: -o
--model
string
Filter by model name

Examples

# 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 for relationships by kind, type, subtype, or model.

Usage

mesheryctl relationship search [flags]

Flags

--kind
string
Filter by relationship kind
--type
string
Filter by relationship type (edge, hierarchical, sibling)
--subtype
string
Filter by relationship subtype
--model
string
Filter by model name

Examples

# 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
string
default:"./"
Output directory for generated documentation. Short form: -o
--model
string
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

Total relationships: 450

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.)

Metadata

  • 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