{"id":28789469,"url":"https://github.com/ryuheechul/k8s-svc-proxy","last_synced_at":"2025-07-24T13:33:34.387Z","repository":{"id":150190280,"uuid":"103343250","full_name":"ryuheechul/k8s-svc-proxy","owner":"ryuheechul","description":"Bring k8s services to your local machine!","archived":false,"fork":false,"pushed_at":"2017-09-15T06:55:34.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-17T22:11:27.569Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/ryuheechul.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,"zenodo":null}},"created_at":"2017-09-13T02:26:07.000Z","updated_at":"2017-09-26T07:03:21.000Z","dependencies_parsed_at":"2023-04-11T10:47:54.654Z","dependency_job_id":null,"html_url":"https://github.com/ryuheechul/k8s-svc-proxy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ryuheechul/k8s-svc-proxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryuheechul%2Fk8s-svc-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryuheechul%2Fk8s-svc-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryuheechul%2Fk8s-svc-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryuheechul%2Fk8s-svc-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryuheechul","download_url":"https://codeload.github.com/ryuheechul/k8s-svc-proxy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryuheechul%2Fk8s-svc-proxy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266850359,"owners_count":23995062,"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","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-06-17T22:10:44.584Z","updated_at":"2025-07-24T13:33:34.379Z","avatar_url":"https://github.com/ryuheechul.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# k8s-svc-proxy\n\u003e Give you a tunnel for you to easily access your k8s service on your local machine\n\n\u003e Powered by Docker, kubectl, Nginx and Shell scripts\n\n## Motivations\n- To make your life easier!\n- Testing k8s services on local machines is not so easy especially when you access them via browser because all the relative path will not work since your service url through `kube proxy` is not a root level.\n\n## Requirements\n\n- For now, you need to clone this source to use the feature\n- It works as a Docker container, so we need your machine to have a Docker installed and running\n- You need to have running `kube proxy` accepting any host just like below\n\u003e `$ kubectl proxy --address 0.0.0.0 --accept-hosts '.*'`\n- It needs `K8S_API_ENDPOINT` env var pointing kubectl proxy\n\n\n## Run\n\n`$ bin/ksp [namespace]/[service] [expose_port]:[target_port]`\n\n### An example\n```shell\n$ kubectl proxy --address 0.0.0.0 --accept-hosts '.* --reject-methods=NONE' # if not running yet\n$ # `curl 0.0.0.0:8001` and it should work if your k8s cluster set up correctly\n$ export K8S_API_ENDPOINT=docker.for.mac.localhost:8001 # if you are using mac and docker version is higher than 17.06\n$ # Make sure you cloned this repository and you are in the directory\n$ bin/ksp default/my-service 3000:80\n```\n\u003e It expose http://docker.for.mac.localhost:8001/api/v1/proxy/namespaces/default/services/my-service:80/ to 0.0.0.0:3000\n\n\u003e Go ahead and try `curl localhost:3000`\n\n## FYI\n\n### About K8S_API_ENDPOINT\n\n- Since it works as a container and the network mode is bridge mode, you can't give `localhost nor 0.0.0.0` to `K8S_API_ENDPOINT`\n- Give the specific ip address of your machine like 192.\\*.\\*.\\* or 10.\\*.\\*.\\*\n- Or just simply use `docker.for.mac.localhost` or `docker.for.win.localhost` if you use docker later than 17.06\n\n### Optionally, use verbose path\n\n- An app like [grafana](https://kubeapps.com/charts/stable/grafana) we use via a browser doesn't work really well either with `$ kubectl proxy` or this project in normal mode.\n- You can make the app work by providing extra env var `export KSP_VERBOSE_PATH=1`\n- Now it will have a longer path just like `kubectl proxy` does but an app like grafana should work fine with it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryuheechul%2Fk8s-svc-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryuheechul%2Fk8s-svc-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryuheechul%2Fk8s-svc-proxy/lists"}