{"id":15982818,"url":"https://github.com/ledfan/debug-pod","last_synced_at":"2026-03-19T05:19:34.625Z","repository":{"id":78796092,"uuid":"314572456","full_name":"LEDfan/debug-pod","owner":"LEDfan","description":null,"archived":false,"fork":false,"pushed_at":"2023-05-19T12:25:15.000Z","size":19,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-09T16:46:25.605Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dockerfile","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/LEDfan.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":"2020-11-20T14:08:28.000Z","updated_at":"2024-03-18T10:06:14.000Z","dependencies_parsed_at":"2025-05-16T19:40:52.899Z","dependency_job_id":"603702d5-aa1c-43c4-9d54-cb76c925f999","html_url":"https://github.com/LEDfan/debug-pod","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LEDfan/debug-pod","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LEDfan%2Fdebug-pod","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LEDfan%2Fdebug-pod/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LEDfan%2Fdebug-pod/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LEDfan%2Fdebug-pod/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LEDfan","download_url":"https://codeload.github.com/LEDfan/debug-pod/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LEDfan%2Fdebug-pod/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29526663,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T21:45:09.491Z","status":"ssl_error","status_checked_at":"2026-02-16T21:44:58.452Z","response_time":115,"last_error":"SSL_read: 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":[],"created_at":"2024-10-08T01:22:15.799Z","updated_at":"2026-02-17T00:31:22.762Z","avatar_url":"https://github.com/LEDfan.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Debug-pod\n\nDocker image with various tools useful when debugging inside a Kubernetes clusters.\n\nThanks to [iptizer](https://github.com/iptizer/swiss) for the idea!\n\n## Included tools\n\n - Docker in Docker: https://github.com/cruizba/ubuntu-dind (Thanks [@cruizba](http://github.com/cruizba) !)\n - A webserver that outputs information about the incoming request: https://github.com/mendhak/docker-http-https-echo (Thanks [@mendhak](https://github.com/mendhak) !)\n - [RDepot CLI](https://github.com/openanalytics/rdepot-cli/)\n - [cloudsend.sh](https://github.com/tavinus/cloudsend.sh)\n - kubectl\n - calicoctl\n - python3 + pip3 + [plumbum](https://plumbum.readthedocs.io/en/latest/index.html)\n - bunch of standard Linux tools\n - [stern](https://github.com/wercker/stern)\n\n\n## sshuttle\n\nThis container can be used with [sshuttle](https://sshuttle.readthedocs.io/en/stable/) + [kuttle](https://github.com/kayrus/kuttle), in order to get access to the Kubernetes network from your local machine.\nThis repository contains a patched [kuttle](kuttle) file. The patch simply adds quotes around `$1` on line 4.\n\n1. install sshuttle:\n\n    ```bash\n    sudo pacman -S sshuttle\n    ```\n\n2. install kuttle:\n\n    ```bash\n    install kuttle /usr/local/bin/kuttle\n    ```\n\n2. create a debug-pod\n3. launch sshuttle, specifying the name of the debug-pod (running in the `default` namespace) and the CIDR of your Kubernetes cluster:\n\n    ```bash\n    sshuttle -r debug-pod -e kuttle 10.42.42.0/20\n    ```\n\nYou can now access the Kubernetes network from your local machine.\n\n### Conditional DNS Forwarding\n\nIn addition to forwarding TCP traffic, sshuttle can forward DNS traffic as well. This is very useful for accesing resources in your cluster using the Kubernetes DNS server (e.g. `kubernetes.default.svc`) or when you have a private DNS zone in your cluster (e.g. using AWS Route53).\nThis can be enabled by simply specifying `--dns` as an option to sshuttle. However, this forwards **all** your DNS traffic through the DNS server of Kubernetes, which is undesirable in most cases.\nA solution is to use [dnsmasq](https://thekelleys.org.uk/dnsmasq/doc.html) on your local machine:\n\n1. install dnsmasq\n\n    ```bash\n    sudo pacman -S dnsmasq\n    ```\n\n2. edit the config file (`/etc/dnsmasq.conf`)\n\n    ```text\n    domain-needed\n    no-resolv\n    no-poll\n    # the following line forwards all subdomains of `my-corporation.com` to the DNS server 10.42.42.2\n    server=/my-corporation.com/10.42.42.2\n    # the following line forwards all other traffic to 9.9.9.9, choose any DNS server you like\n    server=9.9.9.9\n    ```\n\n3. start and enable dnsmasq:\n\n    ```bash\n    sudo systemctl start dnsmasq\n    sudo systemctl enable dnsmasq\n    ```\n\n4. run sshuttle:\n\n    ```bash\n    sshuttle -r debug-pod -e kuttle 10.42.42.0/20 --ns-hosts=10.42.42.2\n    ```\n\n\nThis setup resolves sub-domain of `my-corporation.com` through the DNS server at `10.42.42.2`.\nAll other domains are resolved using `9.9.9.9`.\n\n### Performance\n\nWhen you need to transfer big files using the tunnel add the [`--no-latency-control`](https://sshuttle.readthedocs.io/en/stable/manpage.html#cmdoption-sshuttle-no-latency-control) option to sshuttle.\nWith this option enabled, `iperf3` reports around 150Mbps throughput for my situation.\n\n### Forwarding script\n\nThe following script can be used for convience:\n\n```bash\n#!/usr/bin/env bash\n\nkillall sshuttle\n\nfunction finish {\n    kill $(jobs -p) # kill background loops\n}\n\ntrap finish EXIT\n\n# Cluster 1\nwhile /bin/true; do\n    sshuttle -r '--context my-cluster-1 debug-pod' -e kuttle --no-latency-control --ns-hosts=10.42.42.2 10.42.42.0/20\n    sleep 1\ndone \u0026\n\n# Cluster 2\nwhile /bin/true; do\n    sshuttle -r '--context my-cluster-2 debug-pod' -e kuttle --no-latency-control --ns-hosts=10.142.42.2 10.142.42.0/20\n    sleep 1\ndone \u0026\n\nwait\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fledfan%2Fdebug-pod","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fledfan%2Fdebug-pod","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fledfan%2Fdebug-pod/lists"}