{"id":13644112,"url":"https://github.com/pabateman/kubectl-nsenter","last_synced_at":"2026-01-12T00:39:13.168Z","repository":{"id":38387531,"uuid":"458459394","full_name":"pabateman/kubectl-nsenter","owner":"pabateman","description":"kubectl plugin for pod's linux namespaces command execution via direct node ssh connection","archived":false,"fork":false,"pushed_at":"2025-08-01T12:10:57.000Z","size":1510,"stargazers_count":54,"open_issues_count":1,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-01T13:51:00.238Z","etag":null,"topics":["krew","krew-plugin","kubectl","kubectl-plugin","kubernetes"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pabateman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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":"2022-02-12T08:05:28.000Z","updated_at":"2025-08-01T12:09:00.000Z","dependencies_parsed_at":"2024-01-14T09:18:39.135Z","dependency_job_id":"2aa75d31-3922-4e99-90f8-cdda28ea85a3","html_url":"https://github.com/pabateman/kubectl-nsenter","commit_stats":{"total_commits":49,"total_committers":3,"mean_commits":"16.333333333333332","dds":"0.12244897959183676","last_synced_commit":"2b98bb6cf7379a337fa6d5f4a5df9c5be66e1794"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/pabateman/kubectl-nsenter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabateman%2Fkubectl-nsenter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabateman%2Fkubectl-nsenter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabateman%2Fkubectl-nsenter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabateman%2Fkubectl-nsenter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pabateman","download_url":"https://codeload.github.com/pabateman/kubectl-nsenter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabateman%2Fkubectl-nsenter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28329806,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"ssl_error","status_checked_at":"2026-01-12T00:36:15.229Z","response_time":60,"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":["krew","krew-plugin","kubectl","kubectl-plugin","kubernetes"],"created_at":"2024-08-02T01:01:57.698Z","updated_at":"2026-01-12T00:39:13.146Z","avatar_url":"https://github.com/pabateman.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# kubectl-nsenter\n\nHey, buddy! Tired of the endless debug pods/node shells? `kubectl-nsenter` summoned to help you!\n\n## Installation\n\n```bash\nkubectl krew install nsenter\n```\n\n## TL;DR\n\n![nsenter demo](/img/demo.gif)\n\n```bash\nGLOBAL OPTIONS:\n   --kubeconfig value                                       kubernetes client config path (default: $HOME/.kube/config) [$KUBECONFIG]\n   --container value, -c value                              use namespace of specified container. By default first running container will taken\n   --context value                                          override current context from kubeconfig\n   --namespace value, -n value                              override namespace of current context from kubeconfig\n   --user value, -u value                                   set username for ssh connection to node\n   --password, -s                                           force ask for node password prompt (default: false)\n   --ssh-auth-sock value                                    sets ssh-agent socket (default: current shell auth sock) [$SSH_AUTH_SOCK]\n   --host value                                             override node ip\n   --port value, -p value                                   sets ssh port\n   --ns value [ --ns value ]                                define container's pid linux namespaces to enter. Sends transparently to nsenter cmd (default: \"n\")\n   --interactive, -i                                        keep ssh session stdin (default: false)\n   --tty, -t                                                allocate pseudo-TTY for ssh session (default: false)\n   --ssh-opt value, -o value [ --ssh-opt value, -o value ]  same as -o for ssh client\n   --use-node-name, -j                                      use kubernetes node name to connect with ssh. Useful with ssh configs (default: true) [$KUBECTL_NSENTER_USE_NODE_NAME]\n   --help, -h                                               show help\n   --version, -v                                            print the version\n```\n\n## What the kind is kubectl-nsenter?\n\n`kubectl-nsenter` let you to exec to any pod's container linux namespace, such as network, mount etc. It uses a direct connection to node via ssh and supports two form of authentication: password and key. For auth by key it uses ssh-agent.\n\n## How can I use this?\n\nFirst we gotta talk about requirements:\n\n- You **must** have a **root access** to node (with password or not) where pod is running\n- Your client station **must** have ssh client binary in $PATH\n- Your node **must** have CRI client for discovering container's pid (e.g. `crictl` for **containerd** or `docker` for **docker engine**)\n\nIf you can handle this requirements, we're moving on':\n\n**Discover pod's opened tcp-ports**:\n\n```bash\n$ kubectl-nsenter -u vagrant httpbin-5876b4fbc9-rtvrq ss -tln\nState         Recv-Q        Send-Q               Local Address:Port               Peer Address:Port       Process\nLISTEN        0             128                        0.0.0.0:80                      0.0.0.0:*\n```\n\n**Discover pod's mounts**:\n\n```bash\n$ kubectl-nsenter -u vagrant --ns m --ns p  httpbin-5876b4fbc9-rtvrq mount -t xfs\n/dev/vda1 on /dev/termination-log type xfs (rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,noquota)\n/dev/vda1 on /etc/resolv.conf type xfs (rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,noquota)\n/dev/vda1 on /etc/hostname type xfs (rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,noquota)\n/dev/vda1 on /etc/hosts type xfs (rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,noquota)\n```\n\n**Or start a full shell session as well**:\n\n```bash\n$ kubectl-nsenter -it httpbin-5876b4fbc9-rtvrq bash\n[root@w-01 ~]#\n```\n\nNote, that ssh session requires keeping stdin (-i) and allocating pseudo-TTY (-t). Same as `docker run -it alpine sh`.\n\n**Ultimate feature! Dump traffic from pod right on your station's wireshark!**\n\n```bash\nkubectl-nsenter postgres tcpdump -nnni any -w- | wireshark -ki-\n```\n\n## Init Containers\n\nIf desired pod is still initializing, nsenter will pick currently running container or fail, if none of init containers is running.\n\n## Supported technologies\n\nContainer Runtimes Clients:\n\n- docker;\n- crictl - expected to be present on nodes with cri-o runtime;\n- nerdctl - expected to be present on nodes with containerd runtime; crictl will be used as a fallback.\n\nOS:\n\n- Unix-like.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpabateman%2Fkubectl-nsenter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpabateman%2Fkubectl-nsenter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpabateman%2Fkubectl-nsenter/lists"}