{"id":38178116,"url":"https://github.com/little-angry-clouds/kubectl-ssh-proxy","last_synced_at":"2026-01-16T23:38:22.310Z","repository":{"id":57509295,"uuid":"234164861","full_name":"little-angry-clouds/kubectl-ssh-proxy","owner":"little-angry-clouds","description":"Kubectl plugin to launch a ssh socks proxy and use it","archived":false,"fork":false,"pushed_at":"2020-02-04T20:48:31.000Z","size":111,"stargazers_count":47,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T13:33:03.167Z","etag":null,"topics":["kubectl","kubernetes","openssh","plugin"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/little-angry-clouds.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}},"created_at":"2020-01-15T20:16:35.000Z","updated_at":"2024-06-20T13:33:03.169Z","dependencies_parsed_at":"2022-08-30T07:11:11.232Z","dependency_job_id":null,"html_url":"https://github.com/little-angry-clouds/kubectl-ssh-proxy","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/little-angry-clouds/kubectl-ssh-proxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/little-angry-clouds%2Fkubectl-ssh-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/little-angry-clouds%2Fkubectl-ssh-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/little-angry-clouds%2Fkubectl-ssh-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/little-angry-clouds%2Fkubectl-ssh-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/little-angry-clouds","download_url":"https://codeload.github.com/little-angry-clouds/kubectl-ssh-proxy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/little-angry-clouds%2Fkubectl-ssh-proxy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28487764,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T22:54:02.790Z","status":"ssl_error","status_checked_at":"2026-01-16T22:50:10.344Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["kubectl","kubernetes","openssh","plugin"],"created_at":"2026-01-16T23:38:21.711Z","updated_at":"2026-01-16T23:38:22.301Z","avatar_url":"https://github.com/little-angry-clouds.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kubectl SSH Proxy\n\n[![License](https://img.shields.io/github/license/little-angry-clouds/kubectl-ssh-proxy.svg)](https://github.com/little-angry-clouds/kubectl-ssh-proxy/blob/master/LICENSE)\n[![Go Report Card](https://goreportcard.com/badge/github.com/little-angry-clouds/kubectl-ssh-proxy)](https://goreportcard.com/report/github.com/little-angry-clouds/kubectl-ssh-proxy)\n\u003ca href='https://github.com/jpoles1/gopherbadger' target='_blank'\u003e![gopherbadger-tag-do-not-edit](https://img.shields.io/badge/Go%20Coverage-33%25-brightgreen.svg?longCache=true\u0026style=flat)\u003c/a\u003e\n![Main](https://github.com/little-angry-clouds/kubectl-ssh-proxy/workflows/Main/badge.svg)\n\nThis plugin aims to make your life easier when using `kubectl` a cluster\nthat's behind a SSH bastion.\n\n## TL;DR\n\n`kubectl` SSH Proxy basically spans a socks proxy in the background that\n`kubectl` can use. The configuration is pretty simple, edit your\n`$KUBECONFIG`-ssh-proxy file and add the next section:\n\n``` yaml\nkube-ssh-proxy:\n  ssh:\n    host: my-bastion\n    port: 22\n    user: my-user\n    key_path: /home/my-user/.ssh/id_rsa\n  bind_port: 8080\n```\n\nIt should be straightforward. The SSH connection sets the host at `my-bastion`, the\nport at `22`, the user at `my-user` and the key to be used is\n`/home/my-user/.ssh/id_rsa`. The `bind_port` is the port that will be set as a\nproxy in your local machine.\n\nThe `key_path` is optional, if you don't set it, the plugin will try to use\nan existing `ssh-agent` session.\n\nThe plugin's configuration path can also be set with the `$KUBECONFIG-SSH-PROXY`\nenvironment variable.\n\n## Install\n\nGet the latest release from\n[Github](https://github.com/little-angry-clouds/kubectl-ssh-proxy/releases):\n\n``` bash\nlatest=$(curl --silent \"https://api.github.com/repos/little-angry-clouds/kubectl-ssh-proxy/releases/latest\" | grep '\"tag_name\":' | sed -E 's/.*\"([^\"]+)\".*/\\1/')\ncurl --silent https://github.com/little-angry-clouds/kubectl-ssh-proxy/releases/download/$latest/kubectl-ssh-proxy-linux-386.tar.gz -O -L\ntar xf kubectl-ssh-proxy-linux*.tar.gz\nsudo mv bin/kubectl-ssh_proxy* /usr/local/bin/kubectl-ssh_proxy\nsudo mv bin/kube-ssh-proxy* /usr/local/bin/kube-ssh-proxy-ssh-bin\n```\n\nDisclaimer: There's binaries for windows and macOs too, but I haven't test them.\nIf you do and have some feedback, please share!\n\n## Demo\n\n![Image](./demo.png)\n\n## FAQ\n### Why there's two binaries?\n\nFirst let's explain what these binaries do. The main program, the plugin, sends the second\none, a minimalistic ssh binary, to the background.\n\nThe plugin's domain is the reading of the configuration and managing the status\nof the SSH proxy. The ssh's binary domain is just span a ssh proxy.\n\nSaid that, what we're trying to do here is to have a process running a ssh proxy\nand have `kubectl` to use it. To do so they have to be two different process,\nbecause otherwise the proxy would make it impossible to use `kubectl`.\n\n### Why make a ssh binary if there's already one?\n\nIt's a minimalistic version. Openssh it's pretty cool, but this is more simple.\nYou can start a ssh proxy like this:\n\n```bash\nkube-ssh-proxy-ssh-bin -H your.domain.com -p 22 -u your-user -b 8080 -k /home/your-user/.ssh/id_rsa\n```\n\nIt only does this, so using openssh for this was a bit of an overkill. Also,\nthis way we don't have that dependency, which theoretically makes it easier to\nhave a multiplatform program.\n\n### Why two different configuration files?\n\nThe development first started with the ssh's proxy configuration in the\n`kubeconfig` file, but one day when changing the context, I realized that\nchanging the context **deletes** and rewrites all the file. So, if something is\nnot part of what `kubectl` expects, it's deleted.\n\n### Why doesn't the proxy automatically set the environment variable?\n\nBecause the program is executed in a subshell, and a subshell can't never modify\nvariables from it's parent shell. Another example of this is aws cli's command\n[ecr\nget-login](https://docs.aws.amazon.com/cli/latest/reference/ecr/get-login.html).\nWhat you can do is to just eval the output, since everything that should not be\nevaluated has a comment first:\n\n``` bash\n\u003e kubectl ssh-proxy --start\n# The SSH Proxy started!\n# Eval the next:\nexport HTTPS_PROXY=socks5://localhost:8080\n```\n\nYou can do it like this:\n\n``` bash\n\u003e eval `kubectl ssh-proxy --start`\n```\n\n### What if the cluster's domain is private?\n\nNo worries, the DNS resolution is done in the bastion machine. If the bastion\ncan resolve the domain, `kubectl` will.\n\n### What OS does it support?\n\nSince it's Go, it should work on any OS. There's binaries for windows and macOs\ntoo, but I haven't test them. If you do and have some feedback, please share!\n\n## Others\n\nThanks to the folks at #go-nuts freenode's irc channel for being so friendly,\nsome of them helped to define what I need to do with this plugin.\n\n## License\n\nGPL3\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flittle-angry-clouds%2Fkubectl-ssh-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flittle-angry-clouds%2Fkubectl-ssh-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flittle-angry-clouds%2Fkubectl-ssh-proxy/lists"}