{"id":19102703,"url":"https://github.com/kayrus/kuttle","last_synced_at":"2025-04-15T06:53:16.053Z","repository":{"id":36693832,"uuid":"134905768","full_name":"kayrus/kuttle","owner":"kayrus","description":"Kubernetes wrapper for sshuttle","archived":false,"fork":false,"pushed_at":"2023-01-29T20:36:15.000Z","size":11,"stargazers_count":169,"open_issues_count":5,"forks_count":10,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-15T06:53:10.808Z","etag":null,"topics":["kubectl","kubernetes","sshuttle"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kayrus.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":"2018-05-25T21:21:00.000Z","updated_at":"2025-03-24T05:02:53.000Z","dependencies_parsed_at":"2022-07-12T16:12:36.319Z","dependency_job_id":null,"html_url":"https://github.com/kayrus/kuttle","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayrus%2Fkuttle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayrus%2Fkuttle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayrus%2Fkuttle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayrus%2Fkuttle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kayrus","download_url":"https://codeload.github.com/kayrus/kuttle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249023711,"owners_count":21199958,"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":["kubectl","kubernetes","sshuttle"],"created_at":"2024-11-09T03:56:52.154Z","updated_at":"2025-04-15T06:53:16.030Z","avatar_url":"https://github.com/kayrus.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kuttle: kubectl wrapper for sshuttle without SSH\n\nKuttle allows you to easily get an access into your Kubernetes network environment. SSH access is not required, since `kubectl` is used instead of `ssh`.\n\nIn comparison with [Telepresence](https://www.telepresence.io), `kuttle` only proxies Kubernetes network onto your local laptop.\n\n# Installation\n\nInstall `sshuttle` following [official documentation](https://sshuttle.readthedocs.io/en/stable/installation.html) or use your distro's package manager:\n\n* MacOS: `brew install sshuttle`\n* Debian/Ubuntu: `apt-get install sshuttle`\n* Fedora/RedHat/CentOS: `yum install sshuttle`\n\nDownload [kuttle](https://github.com/kayrus/kuttle/raw/master/kuttle):\n\n```sh\nwget https://github.com/kayrus/kuttle/raw/master/kuttle\nchmod +x kuttle\n```\n\nAdditionally you can place `kuttle` into `$PATH`\n\n# How does it work?\n\nUnder the hood `sshuttle` spawns a remote python oneliner that evaluates a server code, received via `stdin`, which *proxies* the traffic. To get a connection to the remote server `sshuttle` usually uses `ssh`. `kuttle` allows `sshuttle` to use `kubectl` without any `ssh` dependencies.\n\n## Regular sshuttle process tree\n\n```sh\n$ pstree -pal `pidof -x sshuttle`\nsshuttle,1489 /usr/bin/sshuttle -r remote.example.com 10.254.0.0/16\n  ├─ssh,1492 remote.example.com -- exec /bin/sh -c 'P=python3.5; $P -V 2\u003e/dev/null || P=python; exec \"$P\" -c '\"'\"'import sys, os; verbosity=0; sys.stdin = os.fdopen(0, \"rb\"); exec(compile(sys.stdin.read(978), \"assembler.py\", \"exec\"))'\"'\"''\n  └─sudo,1490 -p [local sudo] Password:  PYTHONPATH=/usr/lib/python3/dist-packages -- /usr/bin/python3 /usr/bin/sshuttle --method auto --firewall\n      └─python3,1491 /usr/bin/sshuttle --method auto --firewall\n```\n\n## sshuttle + kuttle process tree\n\n```sh\n$ pstree -pal `pidof -x sshuttle`\nsshuttle,1538 /usr/bin/sshuttle -r kuttle -e kuttle 10.254.0.0/16\n  ├─kubectl,1541 exec -i kuttle -- /bin/sh -c exec /bin/sh -c 'P=python3.5; $P -V 2\u003e/dev/null || P=python; exec \"$P\" -c '\"'\"'import sys, os; verbosity=0; sys.stdin = os.fdopen(0, \"rb\"); exec(compile(sys.stdin.read(978), \"assembler.py\", \"exec\"))'\"'\"''\n  │   ├─{kubectl},1544\n  │   ├─{kubectl},1547\n  │   ├─{kubectl},1551\n  │   ├─{kubectl},1552\n  │   ├─{kubectl},1553\n  │   ├─{kubectl},1556\n  │   ├─{kubectl},1557\n  │   └─{kubectl},1558\n  └─sudo,1539 -p [local sudo] Password:  PYTHONPATH=/usr/lib/python3/dist-packages -- /usr/bin/python3 /usr/bin/sshuttle --method auto --firewall\n      └─python3,1540 /usr/bin/sshuttle --method auto --firewall\n```\n\n# Target Kubernetes pod requirements\n\nSince `sshuttle` uses python interpreter, python should be installed inside target pod's container.\n\nPrior to version 0.78.2, sshuttle used `netstat` to [list routes](https://github.com/sshuttle/sshuttle/pull/132). If your `sshuttle` version is older than 0.78.2, you have to ensure that `netstat` CLI is also installed inside pod's container.\n\nSimple alpine container with a minimal python is enough for `kuttle`. You can use the `kubectl` command below in order to spawn ready-to-use pod as a VPN server:\n\n```sh\nkubectl run kuttle --image=alpine:latest --restart=Never -- sh -c 'apk add python3 --update \u0026\u0026 exec tail -f /dev/null'\nsshuttle -r kuttle -e kuttle 0.0.0.0/0\n```\n\n# Examples\n\nRoute local requests to the `10.254.0.0/16` subnet via `pod-with-python` pod in your Kubernetes cluster:\n\n```sh\nsshuttle -r '--context my-context --namespace default pod-with-python' -e /path/to/kuttle 10.254.0.0/16\n```\n\nUse your Kubernetes pod as a VPN server with DNS requests being resolved by pod:\n\n```sh\nsshuttle --dns -r '--context my-context --namespace default pod-with-python' -e /path/to/kuttle 0.0.0.0/0\n```\n\nIf you already have set `kubectl` defaults and placed `kuttle` in `$PATH`, just specify the pod name:\n\n```sh\nsshuttle --dns -r pod-with-python -e kuttle 0.0.0.0/0\n```\n\n# Credits\n\nThanks to [sshuttle](https://github.com/sshuttle/sshuttle) authors and [@databus23](https://github.com/databus23) for getting me inspired.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkayrus%2Fkuttle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkayrus%2Fkuttle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkayrus%2Fkuttle/lists"}