Knowledge Base updated: 2026-11-22
kftray knowledge base
Orientation
kftray is a Rust workspace for managing Kubernetes and SSH port forwards through a Tauri desktop application, a terminal UI, and service-facing executables.
The desktop product combines kftray-tauri native capabilities with the React/Vite frontend. Forwarding lifecycle, endpoint exposure, and privileged binding live in workspace crates shared by the desktop and terminal experiences.
Critical configuration and domain state are defined in kftray-commons; runtime connection state is coordinated by the forwarding subsystem and consumed by desktop, terminal, MCP, and proxy components.
System map
flowchart TD
User[User] --> Desktop[Desktop application]
User --> Terminal[Terminal experience]
Client[External client] --> MCP[MCP service]
Client --> Proxy[Proxy server]
Desktop --> Native[Native desktop orchestration]
Desktop --> Frontend[Desktop frontend]
Desktop --> Config[Configuration workflows]
Native --> Common[Shared domain platform]
Terminal --> Common
MCP --> Common
Proxy --> Common
Config --> Common
Common --> Forwarding[Connection forwarding]
Forwarding --> K8s[Kubernetes port forwarding]
Forwarding --> SSH[SSH forwarding]
Forwarding --> Exposure[Endpoint exposure and TLS]
Desktop --> Observability[Observability and user controls]
flowchart LR
Config[Configuration] --> State[Shared configuration state]
State --> Forwarding[Forwarding lifecycle]
Forwarding --> Local[Local listener]
Local --> Target[Kubernetes, SSH, or exposed target]
Forwarding --> Logs[HTTP logging and monitoring]
Glossary
- kftray-tauri: The native Tauri application that hosts the desktop UI and exposes native commands.
- kftui: The terminal user interface for operating forwarding workflows.
- Expose: Functionality that makes a forwarded endpoint available beyond its default local listener.
- MCP service: The Model Context Protocol server that exposes kftray operations to MCP clients.
- Shared configuration state: Common configuration and runtime concepts provided by
kftray-commons.
Invariants
- Shared configuration contracts must remain compatible across consumers; evidence:
crates/kftray-commons/src/**is used as the common domain layer. - Native UI-to-service operations pass through the Tauri command boundary; evidence:
crates/kftray-tauri/src/commands/**. - Forwarded endpoint lifecycle concerns belong in the forwarding subsystem rather than individual UIs; evidence:
crates/kftray-portforward/src/**. - External MCP and proxy interfaces must use shared domain concepts rather than duplicate configuration models; evidence:
crates/kftray-mcp/src/**,crates/kftray-server/src/**, andcrates/kftray-commons/src/**. - Observability and user-control features remain opt-in or explicitly user-driven where applicable; evidence:
crates/kftray-tauri/src/**telemetry and shortcut handling patterns.
Routing table
crates/kftray-tauri/**-> Desktop application- crates/…/main.rs -> Native desktop orchestration
crates/kftray-tauri/src/commands/**-> Native desktop orchestrationui/**-> Desktop frontendcrates/kftray-tauri/src/commands/config/**-> Configuration workflowsexamples/**-> Configuration workflowscrates/kftray-portforward/**-> Connection forwardingcrates/kftray-portforward/src/kubernetes/**-> Kubernetes port forwardingcrates/kftray-portforward/src/ssh/**-> SSH forwardingcrates/kftray-portforward/src/expose/**-> Endpoint exposure and TLScrates/kftray-mcp/**-> Service integrationscrates/kftray-server/**-> Service integrationscrates/kftray-mcp/src/**-> MCP servicecrates/kftray-server/src/**-> Proxy servercrates/kftui/**-> Terminal experiencecrates/kftui/src/**-> Terminal application workflowscrates/kftray-http-logs/**-> HTTP logging and network monitoringcrates/kftray-network-monitor/**-> HTTP logging and network monitoringcrates/kftray-tauri/src/telemetry/**-> Telemetry and shortcutscrates/kftray-tauri/src/shortcuts/**-> Telemetry and shortcutscrates/kftray-commons/**-> Shared domain platformcrates/kftray-commons/src/models/**-> Shared models and utilitiescrates/kftray-commons/src/utils/**-> Shared models and utilities- crates/…/window.rs -> Observability and user controls