generating-ovn-topology
БесплатноЗапускает вложенные скриптыНе проверенGenerates and displays OVN-Kubernetes network topology diagrams showing logical switches, routers, ports with IP/MAC addresses in Mermaid format
Об этом скилле
Quick Start - OVN Topology Generation
IMMEDIATE ACTIONS (follow these steps in order):
Detect Cluster: Find the OVN-Kubernetes cluster kubeconfig
Run:
scripts/detect-cluster.sh 2>/dev/nullThe 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.:
1|/home/user/.kube/kind-config|kind-ovn|3|ovn-kubernetes 2|/home/user/.kube/config|prod-cluster|12|openshift-ovn-kubernetesDecision 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
KCfor 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.).
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 detected → AI must ask user for confirmation
When exit code 2 is returned:
- Parse the stdout to get the list of write permissions
- Display the permissions clearly to the user using a formatted message
- Explain that:
- This skill performs ONLY read-only operations
- No cluster modifications will be made
- The warning is for transparency about their access level
- List read-only operations: kubectl get, kubectl exec (ovn-nbctl list), local file writes
- List forbidden operations: kubectl create/delete/patch, ovn-nbctl modifications
- Ask the user explicitly: "You have cluster admin permissions. This command will only perform read-only operations. Do you want to proceed?"
- If user says yes → continue, if no → stop
Example of proper user communication:
⚠️ WARNING: Write Permissions Detected Your kubeconfig has cluster admin permissions: • Delete pods, deployments, services • Create and modify resources • Full cluster access 📋 IMPORTANT: This command will ONLY perform read-only operations: ✅ kubectl get (pods, nodes) ✅ kubectl exec (to run read-only ovn-nbctl list commands) ✅ Local file writes (topology diagram) Operations that will NEVER be performed: ❌ kubectl create/delete/patch/apply ❌ ovn-nbctl modifications ❌ Any cluster state changes Do you want to proceed with read-only topology generation?Security Note: This step ensures informed consent. The user must be explicitly aware that their cluster admin credentials are accessible to the AI agent (acting on their behalf), even though only read-only operations will be performed. This transparency is critical for security and trust.
Check Output File: Ask user if
ovn-topology-diagram.mdexists:- (1) Overwrite, (2) Custom path, (3) Timestamp, (4) Cancel
Create Private Temp Directory: Create a private temporary directory using
mkdtempand use it for all temporary files.TMPDIR=$(mktemp -d)Collect OVN Data: Get full topology data from the cluster
Run:
scripts/collect_ovn_data.py "$KC" "$TMPDIR"Detail files written to
$TMPDIR:ovn_switches_detail.txt- node|uuid|name|other_configovn_routers_detail.txt- node|uuid|name|external_ids|optionsovn_lsps_detail.txt- node|name|addresses|type|optionsovn_lrps_detail.txt- node|name|mac|networks|optionsovn_pods_detail.txt- namespace|name|ip|node
Analyze Placement: Determine per-node vs cluster-wide components
Run:
scripts/analyze_placement.py "$TMPDIR"Placement results written to
$TMPDIR:ovn_switch_placement.txt- name|placement (per-node|cluster-wide|cluster-wide-visual)ovn_router_placement.txt- name|placement (per-node|cluster-wide|cluster-wide-visual)
Generate Diagram: Create Mermaid
graph BTdiagram- Read
$TMPDIR/ovn_switch_placement.txt
- Read
Установить generating-ovn-topology в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
BashReadWriteВложенные файлы
FAQ
Что делает скилл generating-ovn-topology?
Generates and displays OVN-Kubernetes network topology diagrams showing logical switches, routers, ports with IP/MAC addresses in Mermaid format
Как установить скилл generating-ovn-topology?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл generating-ovn-topology запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
ci-review
The scan that the plugin's GitHub Action runs.
от Anthropicazure-static-web-apps
Helps create, configure, and deploy Azure Static Web Apps using the SWA CLI. Use when deploying static sites to Azure, setting up SWA local development…
от GitHubai-ready
Make any repo AI-ready — analyzes your codebase and generates AGENTS.md, copilot-instructions.md, CI workflows, issue templates, and more. Mines your PR…
от GitHubaws-cdk-python-setup
Setup and initialization guide for developing AWS CDK (Cloud Development Kit) applications in Python. This skill enables users to configure environment…
от GitHub