kubefwd kubernetes service forwarding
v1.x ·· UTC part of txn2 ↗

project / kubefwd

org / txn2

est. 2017

cncf landscape ↗

openssf · slsa 3

kubefwd v1.x · go kubernetes port forwards.

kubefwd port-forwards Kubernetes services in bulk: a single service, a whole namespace, several namespaces at once, or several clusters at once, optionally filtered by label or field selector. Each service it touches gets its own 127.x.x.x loopback address with the cluster hostname written to /etc/hosts. In-cluster connection strings (http://api:8080, redis-cli -h cache, mysql -h db) resolve and work without modification. Multiple databases on port 3306, multiple gateways on 443. No conflicts, no remapping, no environment-specific config.

Watches Kubernetes events and reconnects automatically on pod churn. Handles headless services with one address per pod, port remapping, custom domain suffixes, and IP reservation. Drive it from an interactive TUI with live traffic and log streaming, a 40+ endpoint REST API, or an MCP server for AI assistants. Apache 2.0, on the CNCF Landscape since 2018.

§ 01 / install · run

Install. Then drive it.

Install with brew, winget, apt, or grab a release binary. Run with sudo so kubefwd can write /etc/hosts and bind low ports. Use the interactive TUI for live cluster state, hit the REST API to script forwards, or wire the MCP server into an AI assistant.

CLI-001 · go · getting started ↗

tui mode

Browse namespaces, watch traffic, stream pod logs.

Start without arguments and pick services from a list, or forward a whole namespace and let the TUI render live state. Each row shows bytes in/out, sparkline, and reconnect status. Press ? for help, r to reconnect errored services, q to quit.

~ / kubefwd
$ brew install kubefwd
$ sudo -E kubefwd svc -n my-namespace --tui
  press ? for help, q to quit

# in another terminal, services resolve by name:
$ curl http://api-gateway:8080
$ redis-cli -h cache -p 6379
$ mysql -h database -P 3306

API-002 · http · api reference ↗

api & mcp

Programmatic control. AI-assistant integration via MCP.

40+ HTTP endpoints for adding namespaces, querying metrics, streaming events. Or talk to your AI about your work, not your tools: claude mcp add kubefwd and ask "connect me to staging redis" in plain English.

~ / api
# start in idle mode, api enabled by default
$ sudo -E kubefwd

# list namespaces, add one, watch services
$ curl kubefwd.internal/api/v1/namespaces
$ curl -X POST kubefwd.internal/api/v1/namespaces \
       -d '{"namespace":"staging"}'
$ curl kubefwd.internal/api/v1/services

# or wire it to claude
$ claude mcp add kubefwd -- kubefwd mcp

§ 02 / what it does

A service per ip. Local, exactly as in cluster.

kubefwd reaches every service the way an in-cluster pod would. No port collisions, no environment-specific config, no docker-compose drift.

  1. 001
    unique loopback ip per service

    Each service gets its own 127.x.x.x address. Many databases on port 3306, many web services on port 80. No conflicts, no remapping. The local network mirrors the cluster network.

    network
  2. 002
    /etc/hosts integration

    Service names resolve to the assigned loopback IPs through the host file. Any application, any language, no configuration to teach. Backup of the original hosts file is kept at ~/hosts.original.

    dns / hosts
  3. 003
    auto-reconnect with backoff

    Pods restart, kubefwd re-establishes the forward. Exponential backoff from 1s to 5min ceiling. Watch events keep the local state aligned with cluster reality during rolling deploys.

    runtime
  4. 004
    interactive tui

    Bubble Tea TUI with live bandwidth sparklines, pod log streaming, and HTTP request detection. Filter, navigate, reconnect, all from the keyboard. Full help overlay on ?.

    tui
  5. 005
    rest api · 40+ endpoints

    Add namespaces, register services, query metrics, stream SSE events. Drives editors, CI tooling, and any process that wants to script local cluster access.

    api
  6. 006
    mcp server for ai clients

    Drop-in MCP server. Claude, Cursor, and any MCP-capable assistant can connect, browse cluster services, and forward what your task needs. Talk about the work, not the tooling.

    mcp
  7. ··· + more

// open source

kubefwd is one of several open source components by Craig Johnston, sponsored by Deasil Works, Inc. and Plexara. Released under the Apache 2.0 license. Featured in the CNCF Landscape.