{"id":21275435,"url":"https://github.com/tmsmr/k4wd","last_synced_at":"2026-05-22T05:21:06.957Z","repository":{"id":216974927,"uuid":"742849253","full_name":"tmsmr/k4wd","owner":"tmsmr","description":"kubectl port-forward on steroids","archived":false,"fork":false,"pushed_at":"2024-02-20T05:43:32.000Z","size":87,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T03:24:32.352Z","etag":null,"topics":["debugging-tool","development","k8s","kubernetes","port-forward"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tmsmr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-13T14:57:26.000Z","updated_at":"2024-02-11T17:53:54.000Z","dependencies_parsed_at":"2024-01-14T00:26:12.226Z","dependency_job_id":"ef81ecf3-a14e-4474-80f7-893d10e639de","html_url":"https://github.com/tmsmr/k4wd","commit_stats":null,"previous_names":["tmsmr/k4wd"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmsmr%2Fk4wd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmsmr%2Fk4wd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmsmr%2Fk4wd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmsmr%2Fk4wd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tmsmr","download_url":"https://codeload.github.com/tmsmr/k4wd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243732303,"owners_count":20338839,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debugging-tool","development","k8s","kubernetes","port-forward"],"created_at":"2024-11-21T09:31:33.019Z","updated_at":"2026-05-22T05:21:01.937Z","avatar_url":"https://github.com/tmsmr.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# K4wd [keɪ ˈfɔrwərd]\n[![Go](https://github.com/tmsmr/k4wd/actions/workflows/push.yml/badge.svg)](https://github.com/tmsmr/k4wd/actions/workflows/push.yml)\n[![Go Report](https://goreportcard.com/badge/github.com/tmsmr/k4wd)](https://goreportcard.com/report/github.com/tmsmr/k4wd)\n\n*`kubectl port-forward` on steroids*\n\n**Docs are WiP**\n\n## General\n*K4wd* allows to make multiple resources in Kubernetes clusters available locally for development and debugging purposes in a pleasant way.\nIt doesn't reinvent the wheel as it is basically a wrapper around [PortForwarder.ForwardPorts](https://pkg.go.dev/k8s.io/client-go/tools/portforward#PortForwarder.ForwardPorts) with some extras.\nWhile there are many similar tools available, *K4wd* might fill a niche. The primary goals are:\n- No need to install additional software in the clusters\n- No elevated privileges or additional software on the client\n- Declarative configuration for complex setups\n- Easy integration in development workflows\n\n## Use cases\n- Local development against upstream resources running in Kubernetes clusters\n- Comparison of workload bahaviours in different Kubernetes contexts\n\n## Quickstart / Demo\n- Install *k4wd*: `go install github.com/tmsmr/k4wd/cmd/k4wd@latest`\n- Have some resources deployed: `kubectl apply -f docs/example.yaml`\n- Write a *Forwardfile* (`docs/Forwardfile`):\n```toml\n[forwards.nginx-pod]\npod = \"nginx\"\nnamespace = \"k4wd\"\nremote = \"80\"\nlocal = \"1234\"\n\n[forwards.nginx-deployment]\ndeployment = \"nginx\"\nnamespace = \"k4wd\"\nremote = \"80\"\n\n[forwards.nginx-service]\nservice = \"nginx\"\nnamespace = \"k4wd\"\nremote = \"http-alt\"\nlocal = \"8080\"\n\n```\n- Start *k4wd*:\n```\n$ k4wd -f docs/Forwardfile\nINFO[09:02:47] starting 3 forwards\nINFO[09:02:47] nginx-service ready (127.0.0.1:8080 -\u003e k4wd/nginx-77b4fdf86c-f4wt6:80) \nINFO[09:02:47] nginx-pod ready (127.0.0.1:1234 -\u003e k4wd/nginx:80) \nINFO[09:02:47] nginx-deployment ready (127.0.0.1:49758 -\u003e k4wd/nginx-77b4fdf86c-f4wt6:80)\n```\n*Note that for nginx-deployment, a random free port was assigned since no value is defined in the Forwardfile*\n- (Optional) Get a new shell and request the active forwards as env variables, e.g.:\n```\n$ k4wd -f docs/Forwardfile -e\nexport NGINX_SERVICE_ADDR=127.0.0.1:8080\nexport NGINX_POD_ADDR=127.0.0.1:1234\nexport NGINX_DEPLOYMENT_ADDR=127.0.0.1:0\n```\n- Use the forwards, e.g.:\n```\n$ eval $(k4wd -f docs/Forwardfile -e)\n$ curl $NGINX_SERVICE_ADDR -I\nHTTP/1.1 200 OK\n...\n```\n- Stop the `k4wd` process and clean up: `kubectl delete -f docs/example.yaml`\n\n## Installation\nFor every tagged version the binaries are attached to the release. You can download it and put it in your `$PATH`.\nReleases are available [here](https://github.com/tmsmr/k4wd/releases). While the binaries are not signed, you can verify the checksum from *SHA256SUMS.txt*.\n\nIf you have *go* installed, you can also install *k4wd* using `go install github.com/tmsmr/k4wd/cmd/k4wd@latest`.\n\n## Usage\n```\n$ k4wd -h\nUsage of k4wd:\n  -d    enable debug logging\n  -e    print environment instead of running k4wd\n  -f string\n        path to Forwardfile (context) (default \"Forwardfile\")\n  -k string\n        alternative path to kubeconfig\n  -o string\n        output format for environment (env, no-export, json, ps, cmd) (default \"env\")\n```\n\n## Forwardfile\n### Configuration\n__TBD__\n\n### Context\n__TBD__\n\n## Limitations\n__TBD__\n\n## Disclaimer\nCheck *LICENSE* for details. If this tool eats your dog, it's not my fault.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmsmr%2Fk4wd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftmsmr%2Fk4wd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmsmr%2Fk4wd/lists"}