{"id":17187206,"url":"https://github.com/tocsoft/kubeconnect","last_synced_at":"2026-01-05T11:14:43.780Z","repository":{"id":44883091,"uuid":"387807739","full_name":"tocsoft/KubeConnect","owner":"tocsoft","description":"KubeConnect is a bulk port forwarding utility for Kubernetes for aiding in local development on k8s hosted applications.","archived":false,"fork":false,"pushed_at":"2024-03-27T09:05:44.000Z","size":1457,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-16T01:05:40.124Z","etag":null,"topics":["csharp","developer-tools","dotnet","k8s","kubernetes","port-forwarding"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tocsoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-07-20T13:52:49.000Z","updated_at":"2024-01-12T18:21:27.000Z","dependencies_parsed_at":"2024-03-27T10:27:46.705Z","dependency_job_id":null,"html_url":"https://github.com/tocsoft/KubeConnect","commit_stats":null,"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tocsoft%2FKubeConnect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tocsoft%2FKubeConnect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tocsoft%2FKubeConnect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tocsoft%2FKubeConnect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tocsoft","download_url":"https://codeload.github.com/tocsoft/KubeConnect/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244752355,"owners_count":20504255,"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":["csharp","developer-tools","dotnet","k8s","kubernetes","port-forwarding"],"created_at":"2024-10-15T01:05:40.003Z","updated_at":"2026-01-05T11:14:43.739Z","avatar_url":"https://github.com/tocsoft.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KubeConnect\n\n\u003e NOTE: This is currently only tested on Windows however the core functionality should run on any OS that can run .net core.\n\nKubeConnect is a bulk port forwarding utility for Kubernetes. Rather than having to start up port forward sessions for each port of \neach service you wish to access instead yu can just run `KubeConnect` and exposes everything in a namespace in one hit.\n\nKubeConnect however does more than just forwards lots of ports on lots of services onto random local ports its cleverer than that, it updates your\nlocal hosts file so the ports exposed on the service are available locally in the same way they where available inside the cluster. Lets say you \nhave 2 services `website`, and `api` both exposing port 80 what `KubeConnect` does is exposes those 2 services both on port 80 on separate local IPs \nwith your `HOSTS` file updated so that `website` resolves to its forwarder and `api` to its, effectively exposes them locally in a similar style to \nhow they appear inside the cluster meaning your code running local can talk to backend services without needing reconfiguration.\n\nAdditionally to exposing services we also expose ingresses, generating custom (and trusted) ssl certificates so they can be access locally without \nthose annoying untrusted cert warnings you get for traditional self signed certificates.\n\nSo now you know to connect into your cluster and expose services inside it to your development machine thats great but you now want to make changes\nto one of the services you have deployed. This is where bridging comes into play with simple run of `KubeConnect bridge --service service-name` come\nin to play. This does a couple of major things it reaches into your cluster and disables the deployment targeted by that service, it then starts up\na new temp pod that acts as a reverse proxy inside the cluster that (with the help of a service running in `kubeconnect`) redirects the traffic to\nany service running on a local port. This then is the piece that squares that circle, allowing your local dev machine act like a part of the deployment\nand the cluster to be accessible to your machine effectively allowing you to switch out a deployed component to one your debugging and changing giving \nyou access to all the other services without having to fake out the entire stack.\n\n## Installing\n\n`KubeConnect` is distributed as a [dotnet tool](https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools).\n\nYou will need an up to date version of the .NET SDK installed. which can be installed from the [dotnet website](https://dotnet.microsoft.com/en-us/download)\n\nOnce you have all that its a simple as running\n\n```powershell\ndotnet tool install --global Tocsoft.KubeConnect.Tool\n```\n\nThis will add the tool to your path where you can run it from anywhere just by invoking `KubeConnect`\n\n## How to `connect` to a cluster.\n\n1. Download the latest version from our [releases page](https://github.com/tocsoft/KubeConnect/releases). \n2. Then run `KubeConnect connect` in the terminal of your choice, accepting an UAC prompts as required (required for modifying hosts file).\n3. Start accessing services.\n\nThis will connect to what ever your default cluster is configured as locally.\n\n### How To bridge\nFirstly you need to have a 2nd process running in `connect` mode.\nOnce its connected you can then run `KubeConnect bridge --service {service-name}`\nand traffic will be redirected from the default (first) exposed port in the service definition to `localhost` so if the service is setup to\nlisten on http://service-name:5555 then that traffic will redirect to http://localhost:5555. however that might not always be wanted especially\nif you plan on starting multiple bridges and they all use the same internal port in the cluster. In that case you can use the\n`KubeConnect bridge --service {service-name}:{target-port}` syntax, this just changes the destination port for the bridge.\n\n\n\n# Project history\n\nThis project as originally written just for the connect side as a quick solution to work around an issue in kubectl/GO kubernetes client that would\ncause some panic state while port forwarding and not receive some expected payload back it returns. Also it didn't handle host file updates etc to make\nthe experience seamless even for those who have no idea/interest in understanding kubernetes but just want to access the code.\n\nThe bridge side came about just to close the loop without having to introduce multiple competing tools that all update hosts files in different way\nintroducing had to diagnose bugs due to different routing kicking in.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftocsoft%2Fkubeconnect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftocsoft%2Fkubeconnect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftocsoft%2Fkubeconnect/lists"}