|
1 | | -# kubefwd Documentation |
2 | | - |
3 | | -> Bulk Kubernetes port forwarding with an interactive TUI, unique IPs per service, and automatic reconnection. |
4 | | -
|
5 | | - |
6 | | - |
7 | | -## What is kubefwd? |
8 | | - |
9 | | -kubefwd is a command-line tool that bulk-forwards Kubernetes services to your local machine. Unlike `kubectl port-forward`, kubefwd: |
10 | | - |
11 | | -- Forwards **all services** in a namespace with one command |
12 | | -- Assigns **unique IP addresses** (127.x.x.x) to each service |
13 | | -- Updates `/etc/hosts` so you can use **service names** directly |
14 | | -- Provides an **interactive TUI** with real-time metrics |
15 | | -- **Auto-reconnects** when pods restart |
16 | | - |
17 | | -## Quick Start |
| 1 | +--- |
| 2 | +title: kubefwd |
| 3 | +description: Bulk port forward Kubernetes services for local development |
| 4 | +hide: |
| 5 | + - navigation |
| 6 | + - toc |
| 7 | +--- |
| 8 | + |
| 9 | +<div class="home-hero"> |
| 10 | + <img src="images/brand-text-800-blk.png" alt="kubefwd" class="hero-logo hero-logo-light"> |
| 11 | + <img src="images/brand-text-800.png" alt="kubefwd" class="hero-logo hero-logo-dark"> |
| 12 | +</div> |
| 13 | + |
| 14 | +<div class="home-intro"> |
| 15 | + <p><strong>kubefwd</strong> enables developers to work locally while accessing services running in Kubernetes. Connect to <code>db:5432</code>, <code>auth:443</code>, <code>redis:6379</code>, all by service name, exactly as in-cluster. No environment config, no Docker Compose. Just run kubefwd.</p> |
| 16 | +</div> |
| 17 | + |
| 18 | +<div class="home-buttons"> |
| 19 | + <a href="getting-started/" class="btn btn-primary">Get Started</a> |
| 20 | + <a href="https://github.com/txn2/kubefwd" class="btn btn-secondary">GitHub</a> |
| 21 | +</div> |
| 22 | + |
| 23 | +<div class="home-screenshot"> |
| 24 | + <img src="images/tui-110-main-active.png" alt="kubefwd TUI"> |
| 25 | +</div> |
| 26 | + |
| 27 | +<div class="home-features"> |
| 28 | + <div class="feature"> |
| 29 | + <span class="feature-icon">🔌</span> |
| 30 | + <div> |
| 31 | + <strong>Unique IP per Service</strong> |
| 32 | + <span>Each service gets its own 127.x.x.x. Multiple databases on port 3306? No conflicts.</span> |
| 33 | + </div> |
| 34 | + </div> |
| 35 | + <div class="feature"> |
| 36 | + <span class="feature-icon">🔄</span> |
| 37 | + <div> |
| 38 | + <strong>Auto-Reconnect</strong> |
| 39 | + <span>Pods restart? kubefwd reconnects automatically with exponential backoff.</span> |
| 40 | + </div> |
| 41 | + </div> |
| 42 | + <div class="feature"> |
| 43 | + <span class="feature-icon">📊</span> |
| 44 | + <div> |
| 45 | + <strong>Interactive TUI</strong> |
| 46 | + <span>Real-time status, traffic metrics, and pod logs in your terminal.</span> |
| 47 | + </div> |
| 48 | + </div> |
| 49 | + <div class="feature"> |
| 50 | + <span class="feature-icon">🌐</span> |
| 51 | + <div> |
| 52 | + <strong>Service Names Work</strong> |
| 53 | + <span>Updates /etc/hosts so any app can access services by name.</span> |
| 54 | + </div> |
| 55 | + </div> |
| 56 | +</div> |
| 57 | + |
| 58 | +<div class="home-install"> |
18 | 59 |
|
19 | 60 | ```bash |
20 | | -# Install |
| 61 | +# macOS |
21 | 62 | brew install txn2/tap/kubefwd |
22 | 63 |
|
23 | | -# Forward all services with the TUI |
| 64 | +# Then forward services |
24 | 65 | sudo -E kubefwd svc -n my-namespace --tui |
25 | 66 | ``` |
26 | 67 |
|
27 | | -Access services by name: |
28 | | - |
29 | | -```bash |
30 | | -curl http://api-service:8080 |
31 | | -mysql -h database -P 3306 |
32 | | -``` |
33 | | - |
34 | | -## Documentation |
35 | | - |
36 | | -### Getting Started |
37 | | - |
38 | | -- [Installation & Quick Start](getting-started.md) - Get up and running |
39 | | - |
40 | | -### Using kubefwd |
41 | | - |
42 | | -- [TUI Guide](tui-guide.md) - Interactive interface, keyboard shortcuts |
43 | | -- [Configuration](configuration.md) - All command line flags and options |
44 | | -- [Advanced Usage](advanced-usage.md) - Multi-namespace, multi-cluster, Docker |
45 | | - |
46 | | -### Reference |
47 | | - |
48 | | -- [Troubleshooting](troubleshooting.md) - Common issues and solutions |
49 | | -- [Architecture](architecture.md) - How kubefwd works under the hood |
50 | | -- [Comparison](comparison.md) - kubefwd vs Telepresence, mirrord, Gefyra |
51 | | - |
52 | | -## Key Features |
53 | | - |
54 | | -### Interactive TUI |
55 | | - |
56 | | -The Terminal User Interface provides: |
57 | | -- Real-time service status monitoring |
58 | | -- Traffic metrics with sparkline graphs |
59 | | -- Pod log streaming |
60 | | -- Keyboard-driven navigation |
61 | | - |
62 | | -Press `?` for help, `q` to quit. |
63 | | - |
64 | | -### Unique IP per Service |
65 | | - |
66 | | -Each service gets its own loopback IP (127.1.27.x), eliminating port conflicts: |
67 | | - |
68 | | -``` |
69 | | -127.1.27.1 api-service |
70 | | -127.1.27.2 database |
71 | | -127.1.27.3 cache |
72 | | -``` |
73 | | - |
74 | | -Multiple services can use the same port (e.g., several databases on 3306). |
75 | | - |
76 | | -### Automatic Reconnection |
77 | | - |
78 | | -With `--tui` or `-a`, kubefwd automatically reconnects when: |
79 | | -- Pods are restarted |
80 | | -- Connections drop |
81 | | -- Services are updated |
82 | | - |
83 | | -Uses exponential backoff (1s → 5min max). |
84 | | - |
85 | | -### Headless Service Support |
86 | | - |
87 | | -For headless services (ClusterIP: None), kubefwd forwards all pods: |
88 | | -- `service-name` → first pod |
89 | | -- `pod-name.service-name` → specific pods |
90 | | - |
91 | | -Essential for StatefulSets and database clusters. |
92 | | - |
93 | | -## Comparison with kubectl |
94 | | - |
95 | | -| Feature | kubectl port-forward | kubefwd | |
96 | | -|---------|---------------------|---------| |
97 | | -| Services per command | One | All in namespace | |
98 | | -| IP allocation | localhost only | Unique IP per service | |
99 | | -| Port conflicts | Manual management | None | |
100 | | -| Service name resolution | Not supported | Automatic | |
101 | | -| Auto-reconnect | No | Yes | |
102 | | -| Monitoring | None | TUI with metrics | |
103 | | - |
104 | | -## Installation Options |
105 | | - |
106 | | -| Platform | Command | |
107 | | -|----------|---------| |
108 | | -| macOS | `brew install txn2/tap/kubefwd` | |
109 | | -| Linux | Download from [releases](https://github.com/txn2/kubefwd/releases) | |
110 | | -| Windows | `scoop install kubefwd` | |
111 | | -| Docker | `docker run txn2/kubefwd ...` | |
112 | | - |
113 | | -See [Getting Started](getting-started.md) for details. |
114 | | - |
115 | | -## Requirements |
116 | | - |
117 | | -- kubectl configured with cluster access |
118 | | -- Root/sudo access (required for /etc/hosts and network interfaces) |
119 | | - |
120 | | -## Source Code |
121 | | - |
122 | | -kubefwd is open source under the Apache 2.0 license. |
| 68 | +</div> |
123 | 69 |
|
124 | | -- GitHub: [https://github.com/txn2/kubefwd](https://github.com/txn2/kubefwd) |
125 | | -- Issues: [https://github.com/txn2/kubefwd/issues](https://github.com/txn2/kubefwd/issues) |
| 70 | +<div class="home-footer"> |
| 71 | + <a href="https://github.com/txn2/kubefwd/releases"><img src="https://img.shields.io/github/release/txn2/kubefwd.svg?style=flat-square" alt="Release"></a> |
| 72 | + <a href="https://github.com/txn2/kubefwd"><img src="https://img.shields.io/github/stars/txn2/kubefwd?style=flat-square" alt="Stars"></a> |
| 73 | + <p>Open source by <a href="https://twitter.com/cjimti">Craig Johnston</a></p> |
| 74 | +</div> |
0 commit comments