Back to Skills

generating-ovn-topology

verified

Generates and displays OVN-Kubernetes network topology diagrams showing logical switches, routers, ports with IP/MAC addresses in Mermaid format

View on GitHub

Marketplace

ai-helpers

openshift-eng/ai-helpers

Plugin

openshift

Repository

openshift-eng/ai-helpers
35stars

plugins/openshift/skills/generating-ovn-topology/SKILL.md

Last Verified

January 21, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/openshift-eng/ai-helpers/blob/main/plugins/openshift/skills/generating-ovn-topology/SKILL.md -a claude-code --skill generating-ovn-topology

Installation paths:

Claude
.claude/skills/generating-ovn-topology/
Powered by add-skill CLI

Instructions

# Quick Start - OVN Topology Generation

**IMMEDIATE ACTIONS** (follow these steps in order):

1. **Detect Cluster**: Find the OVN-Kubernetes cluster kubeconfig

   Run: `scripts/detect-cluster.sh 2>/dev/null`

   The script discovers OVN-Kubernetes clusters:
   - Scans all kubeconfig files: current KUBECONFIG env, ~/.kube/kind-config, ~/ovn.conf, ~/.kube/config
   - Tests ALL contexts in each kubeconfig (not just current-context)
   - Returns parseable list to stdout: `index|kubeconfig|cluster_name|node_count|namespace`
   - Diagnostics go to stderr
   - Exit code: 0=success, 1=no clusters found

   **How to handle the output:**

   The script returns pipe-delimited lines to stdout, one per cluster found, e.g.:
   ```text
   1|/home/user/.kube/kind-config|kind-ovn|3|ovn-kubernetes
   2|/home/user/.kube/config|prod-cluster|12|openshift-ovn-kubernetes
   ```

   **Decision logic:**
   - If **one cluster** found → automatically use it (extract kubeconfig path from column 2)
   - If **multiple clusters** found → show the list to user and ask them to choose by number
   - After selection, extract the kubeconfig path from column 2 of the chosen line
   - Store the selected kubeconfig path in variable `KC` for use in subsequent steps

   **Example output format parsing:**
   - Column 1: Index number (for user selection)
   - Column 2: Kubeconfig file path (this is what you need for `$KC`)
   - Column 3: Cluster display name
   - Column 4: Number of nodes
   - Column 5: OVN namespace name

   **Important**: Parse the output using standard text processing. The exact implementation is up to you - use whatever approach works best (awk, Python, inline parsing, etc.).

2. **Check Permissions**: Verify user's Kubernetes access level and inform about write permissions

   Run: `scripts/check_permissions.py "$KC"`

   The script returns:
   - **Exit 0**: Read-only access or user confirmed → proceed
   - **Exit 1**: Error or user cancelled → stop
   - **Exit 2**: Write permissions 

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
17809 chars