Read-only network topology explorer for OVN on Kube-OVN (RKE2, Harvester) and ovn-kubernetes.
kvovn-topo shows how the OVN logical network of a Kubernetes cluster is wired: VPCs, routers, switches, ports, chassis and the pods and VMs behind them. It reads the OVN Northbound and Southbound databases directly, and joins them into one live graph.
It consists of:
kvovn-topod: a Go daemon that monitors the OVN NB and SB databases, joins them into an in-memory graph, and serves it over HTTP JSON and SSE.kvovn-topo: a k9s-style terminal UI over the same graph.kvovn-topo mcp: an MCP server, so AI agents (OpenCode, Claude Code, agy) can query the graph read-only.
- 🔒 Read-only by design: never writes to OVSDB or to the Kubernetes API, enforced by lint in CI.
- 🗺️ Live joined graph: NB and SB rows joined into VPCs, routers, switches, ports, chassis, NAT, routes, policies and load balancers.
- ⚡ Push updates: OVSDB monitors in, Server-Sent Events out; no polling.
- 🖥️ k9s-style TUI: tree views, relations you can follow, a details pane that explains each object, problems and changes.
- 🩺 Opt-in, contextual diagnostics (
--diag):ovn-trace, tcpdump, conntrack, OVS ports and bridges,ovn-controllerlogs, always run for the selected object on the node that hosts it. - 🤖 MCP server: AI agents can search and read the topology with Tier 0 tools.
- 🧩 Kube-OVN, Harvester and KubeVirt aware: pods and VMs mapped to their ports, chassis mapped to nodes.
- 🔴 OpenShift / ovn-kubernetes: one node (zone) at a time, live or from a capture.
- 🔐 No exposed endpoint: reached through the Kubernetes API service proxy, authorized by
services/proxyRBAC. - 📦 Air-gap friendly: static binaries, a distroless image and a Hauler manifest.
The TUI and kvovn-topo mcp reach the daemon through the Kubernetes API server's service proxy. No port-forward, public IP or Ingress is needed:
flowchart TB
subgraph cluster["Downstream cluster (RKE2 / Harvester)"]
nb[("OVN Northbound :6641")]
sb[("OVN Southbound :6642")]
subgraph d["kvovn-topod (ClusterIP :8080)"]
g["In-memory joined graph<br/>(atomic snapshots)"]
mapper["K8s NodeMapper<br/>(chassis ↔ node)"]
api["HTTP REST + SSE API"]
end
apiserver["Kubernetes API server<br/>authn + services/proxy RBAC"]
end
nb -->|"OVSDB monitor<br/>(leader_only=false)"| g
sb -->|"OVSDB monitor"| g
mapper --- g
g --- api
apiserver -->|"service proxy"| api
tui["kvovn-topo<br/>(TUI)"] -->|"kubeconfig<br/>(Rancher or :6443)"| apiserver
mcp["kvovn-topo mcp<br/>(AI agents, stdio)"] -->|"kubeconfig"| apiserver
ui["Rancher UI Extension<br/>(roadmap)"] -.-> apiserver
The API server authenticates the kubeconfig user and checks services/proxy RBAC on kube-system/kvovn-topod. The security design is in the API & Security Reference.
helm install kvovn-topo oci://ghcr.io/coulof/charts/kvovn-topo --namespace kube-systemTLS, endpoints and viewer RBAC are in the chart README.
Linux (amd64) and macOS (arm64):
VERSION=0.1.0
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')
curl -fsSL https://github.com/coulof/kvovn-topo/releases/download/v${VERSION}/kvovn-topo_${VERSION}_${OS}_${ARCH}.tar.gz | tar -xz kvovn-topo
sudo install kvovn-topo /usr/local/bin/Windows (amd64): download kvovn-topo_<version>_windows_amd64.zip from GitHub Releases and put kvovn-topo.exe on your PATH.
export KUBECONFIG=~/.kube/hv-01.yaml
kvovn-topo # passive (Tier 0)
kvovn-topo --diag # plus exec-based diagnostics (Tier 1)- 🌳 Three tree views:
1VPCs,2Chassis,3Workloads (pods and VMs with their NICs). - 🚨 Problems (
4): unbound ports, gateways without a chassis, NAT-gateway return paths. - 🕒 Changes (
5): everything that changed since start, live. - 🔗 Relations:
Enterfollows a⇢relation to another object,bcomes back. - 📋 Details pane (
i): what the selection is and how it interconnects;ddescribes it,yshows the raw OVSDB row. - 🔎 Filter and commands:
/filters rows and keeps their ancestors for context;:jumps to a view, k9s-style. - 📡 Live updates over SSE, with changed rows highlighted; falls back to polling when a proxy buffers the stream.
- 🩺 Diagnostics (
x, with--diag):ovn-trace, tcpdump, conntrack, OVS ports and bridges, flows andovn-controllerlogs, run on the node that hosts the selection (§6). ▶️ Inspect commands (!): run a details-pane command such askubectl ko nbctl lr-route-listwith the TUI suspended.- 🧭 Pod autodetection: finds
ovn-central,kube-ovn-cniandovs-ovnfor Kube-OVN, elseovnkube-nodefor ovn-kubernetes;--k8s-namespacepins the namespace. - ⚙️ Config file: theme, highlight duration and per-context daemon settings in
~/.config/kvovn-topo/config.yaml(§0). - 💾 Offline:
--fixture(bundled dataset) or--fixture-dir(a capture), no cluster needed.
? lists every key. The TUI guide walks through use cases with screenshots, and its §8 has the full key table.
OpenShift runs ovn-kubernetes in interconnect mode: one NB/SB per node and no central database, so there is no daemon yet. The TUI reads one node (zone) at a time, live through an exec relay or offline from a capture:
kvovn-topo --diag --zone list # the zones (nodes)
kvovn-topo --diag --zone <node> # live, through a pods/exec relay to the node's sockets
KUBECTL=oc hack/capture-fixtures.sh <name> --flavor ovnk
kvovn-topo --fixture-dir testdata/scenarios/<name>/zone-<node> # offlineHow it works and its quirks: OpenShift implementation. The cluster-wide design is proposed in ADR-0005.
kvovn-topo mcp serves Tier 0 tools to AI agents over stdio.
find: Search routers, switches, ports, and chassis by name, IP, MAC, namespace, pod, or VM.get_graph: Retrieve the L3, L2, or chassis topology graph.get_node: Show full detail of one node, including OVSDB columns and Kubernetes identity.list_chassis: List OVN chassis with binding counts and gateway roles.
kvovn-topo must be on the agent's PATH, or use an absolute path.
Add this to your opencode.json (or ~/.config/opencode/opencode.json):
{
"mcp": {
"kvovn-topo": {
"type": "local",
"command": ["kvovn-topo", "mcp"],
"enabled": false
}
}
}claude mcp add kvovn-topo -- kvovn-topo mcpagy mcp add kvovn-topo -- kvovn-topo mcpBackends, result caps and offline use are in the MCP guide; ready-made prompts are in docs/mcp-prompts.md.
- TUI guide: use cases, screens and keys.
- OpenShift implementation: ovn-kubernetes zones, live and offline modes, quirks.
- Concepts: OVN, Kube-OVN and ovn-kubernetes objects, and what goes wrong with them.
- MCP guide and MCP prompts.
- Development: build, test, local daemon, releases.
- API and security: endpoints, service-proxy access, read-only guarantees.
- ADRs: privilege tiers, history, MCP server, CNI flavors, ovn-kubernetes interconnect.
