kubectl port-forward manager and reverse tunnel (ngrok-like) for exposing local services publicly, with TLS termination, HTTP traffic inspection, UDP forwardin
kubectl port-forward manager and reverse tunnel (ngrok-like) for exposing local services publicly, with TLS termination, HTTP traffic inspection, UDP forwardin
kftray and kftui are Kubernetes port forwarding tools that actually work the way you'd expect them to. While kubectl port-forward is fine for quick tasks, it falls apart when pods restart or connections drop – and you're stuck manually reconnecting.
Both kftray (desktop app with tray integration) and kftui (terminal UI) share the same Rust backend and configuration files. They use the Kubernetes watch API to detect when pods come and go, automatically reconnecting your forwards without you having to babysit them. They handle TCP and UDP through a proxy relay in your cluster, support multiple forwards at once, and can even log HTTP traffic for debugging.
To download apps, you can check the download page on the kftray website.
There are plenty of Kubernetes tools out there, but port forwarding has always been weirdly neglected. The main issues with kubectl port-forward:
The tools monitor pod lifecycle events and automatically reconnect to healthy pods when things go sideways. You can manage dozens of forwards from a single interface, forward UDP traffic through a proxy relay, and inspect HTTP requests/responses when you need to debug.
check out our blog post at kftray.app/blog/posts/13-kftray-manage-all-k8s-port-forward.
The desktop app runs in your system tray and provides a GUI for managing port forwards.
The terminal interface for those who prefer staying in the console.
Every release publishes kftray and kftui packages for Debian, Ubuntu, Fedora, and openSUSE through the openSUSE Build Service. Add the repository once, then install either package with your package manager; updates arrive with the regular system upgrade. The commands below install kftui; replace it with kftray for the desktop app.
Debian and Ubuntu – replace Debian_12 with Debian_13, Ubuntu_22.04, Ubuntu_24.04, or Ubuntu_26.04:
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.opensuse.org/repositories/home:/hencavarsan:/kftray/Debian_12/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kftray.gpg
echo "deb [signed-by=/etc/apt/keyrings/kftray.gpg] https://download.opensuse.org/repositories/home:/hencavarsan:/kftray/Debian_12/ /" | sudo tee /etc/apt/sources.list.d/kftray.list
sudo apt update
sudo apt install kftuiFedora – replace Fedora_44 with Fedora_43 if needed:
sudo dnf config-manager addrepo --from-repofile=https://download.opensuse.org/repositories/home:/hencavarsan:/kftray/Fedora_44/home:hencavarsan:kftray.repo
sudo dnf install kftuiopenSUSE – replace openSUSE_Tumbleweed with openSUSE_Leap_16.0 for Leap:
sudo zypper addrepo https://download.opensuse.org/repositories/home:/hencavarsan:/kftray/openSUSE_Tumbleweed/home:hencavarsan:kftray.repo
sudo zypper --gpg-auto-import-keys refresh
sudo zypper install kftuiPackages are signed with the project key of home:hencavarsan:kftray; the .repo files reference it and the apt source pins it with signed-by.
The proxy relay that runs in your cluster to handle TCP/UDP forwarding.
Both tools share the same JSON configuration format. Here's a example:
[
{
"alias": "argocd",
"context": "kind-kftray-cluster",
"kubeconfig": "/Users/henrique/.kube/kind-config-kftray-cluster",
"local_port": 16080,
"namespace": "argocd",
"protocol": "tcp",
"remote_port": 8080,
"service": "argocd-server",
"workload_type": "service",
"http_logs_enabled": true
}
]You can import configs from:
--json and --stdin)kftray supports multiple workload types for different use cases:
The expose workload type lets you share your local development server with your team or expose it to the internet through your Kubernetes cluster. This is useful for:
Example: Expose local service to the internet
{
"alias": "myapp.example.com",
"namespace": "production",
"local_port": 3000,
"local_address": "localhost",
"context": "my-k8s-cluster",
"workload_type": "expose",
"protocol": "tcp",
"domain_enabled": true,
"exposure_type": "public",
"cert_manager_enabled": true,
"cert_issuer": "letsencrypt-prod",
"cert_issuer_kind": "ClusterIssuer",
"ingress_class": "nginx"
}Example: Expose to cluster internal network only
{
"alias": "internal-api",
"namespace": "development",
"local_port": 8080,
"local_address": "localhost",
"context": "my-k8s-cluster",
"workload_type": "expose",
"protocol": "tcp",
"domain_enabled": true,
"exposure_type": "internal"
}For more examples, see the examples directory.
The tools use a shared Rust core that handles all the Kubernetes interaction. Here's the basic flow:
For UDP or when you need to reach external services, we deploy a small relay pod in your cluster that handles the actual forwarding.
Check the releases page for the full changelog.
Releases are blocked if critical or high severity vulnerabilities are found. The CI scans frontend, backend, Docker image, and GitHub Actions using Grype before publishing. You can run the same scan locally with mise run sbom:scan.
SBOMs are generated with Syft in CycloneDX format for each artifact. Links below point to the latest release:
All release artifacts are signed with Cosign and verified with gh attestation verify. Verify them using the GitHub CLI:
gh attestation verify oci://ghcr.io/hcavarsan/kftray-server:latest --owner hcavarsan
gh attestation verify kftui_linux_amd64.tar.gz --owner hcavarsan
gh attestation verify kftray_<version>_amd64.AppImage --owner hcavarsanSBOMs and VEX documents are signed with Cosign using the v3 bundle format:
curl -LO https://github.com/hcavarsan/kftray/releases/latest/download/sbom-kftray.cdx.json
curl -LO https://github.com/hcavarsan/kftray/releases/latest/download/sbom-kftray.cdx.json.bundle.json
cosign verify-blob \
--bundle sbom-kftray.cdx.json.bundle.json \
--certificate-identity-regexp "https://github.com/hcavarsan/kftray" \
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
sbom-kftray.cdx.jsonKFtray builds meet SLSA Level 2 requirements:
| Requirement | Status | Evidence |
|---|---|---|
| Build service | Hosted | GitHub Actions (hosted runners) |
| Signed provenance | Yes | actions/[email protected] |
| Non-forgeable | Yes | GitHub's Sigstore-based attestation |
| Service-generated | Yes | Provenance generated by GitHub, not user |
Want to contribute or build from source? We use mise to manage the development environment.
Quick start:
# Install mise
curl https://mise.run | sh
# Clone and setup
git clone https://github.com/hcavarsan/kftray.git
cd kftray
mise install # Install all tools
mise run setup # Setup dependencies
mise run dev # Start developmentAvailable commands:
mise run dev - Start development modemise run build - Build production appmise run format - Format codemise run lint - Lint with auto-fixmise run test:back - Run testsSee DEVELOPMENT.md for the complete development guide.
We're always looking for contributions. Whether it's bug fixes, new features, or just ideas, we'd love to hear from you.
Check out CONTRIBUTING.md for guidelines
kftray is available under the GPL 3.0 License.
Thanks goes to these wonderful people (emoji key):
No open issues yet, or sync has not completed.