{"id":22442487,"url":"https://github.com/nevercase/k8s-exec-pod","last_synced_at":"2026-03-02T19:08:52.785Z","repository":{"id":38323244,"uuid":"294073844","full_name":"neverCase/k8s-exec-pod","owner":"neverCase","description":"This is a simple and easy way for you to execute commands inside a k8s pod, watch logs through the websocket proxy and even download current or previous logs with a specific container name.","archived":false,"fork":false,"pushed_at":"2023-05-05T02:28:54.000Z","size":138,"stargazers_count":14,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-19T05:41:10.939Z","etag":null,"topics":["k8s-client-go","k8s-exec-pod","k8s-logs-pod","pod-log-download","terminal","websocket-proxy"],"latest_commit_sha":null,"homepage":"","language":"Go","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/neverCase.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}},"created_at":"2020-09-09T10:03:02.000Z","updated_at":"2024-04-20T08:29:00.000Z","dependencies_parsed_at":"2024-06-19T05:18:32.485Z","dependency_job_id":null,"html_url":"https://github.com/neverCase/k8s-exec-pod","commit_stats":{"total_commits":46,"total_committers":2,"mean_commits":23.0,"dds":"0.021739130434782594","last_synced_commit":"df047e2710d10ec82516301a70e17030bfbcc59c"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neverCase%2Fk8s-exec-pod","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neverCase%2Fk8s-exec-pod/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neverCase%2Fk8s-exec-pod/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neverCase%2Fk8s-exec-pod/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neverCase","download_url":"https://codeload.github.com/neverCase/k8s-exec-pod/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228398010,"owners_count":17913564,"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":["k8s-client-go","k8s-exec-pod","k8s-logs-pod","pod-log-download","terminal","websocket-proxy"],"created_at":"2024-12-06T02:19:18.077Z","updated_at":"2026-03-02T19:08:52.702Z","avatar_url":"https://github.com/neverCase.png","language":"Go","readme":"# k8s-exec-pod\nThis is a simple and easy way for you to execute commands inside a k8s pod, watch logs through the websocket proxy and even download current or previous logs with specific container name.\n\n## Notice\n- A terminal is not just an input field. \n- It's a complex system that provides advanced formatting and interactivity with the user, over a plain character stream.\n- Here is a classic case: if you transmit the command `clear` to the ssh pty, then the response you received would be \"clear: command not found\"\n- So we should listen and compare `each character` instead of inputting a full command with the `\\n` (e.g. `\"pwd\\n\"`)\n\n## build server\n```sh\nCGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o exec-bin example/main.go\n...\n./exec-bin  -kubeconfig=$HOME/.kube/config --proxyservice=0.0.0.0:9090\n```\n- if you run the exec binary file inside a k8s pod, just use the command below:\n```\n./exec-bin --proxyservice=0.0.0.0:9090\n```\n\n## run websocket_client for testing\n\n### log mode\n```sh\ngo run websocket_client.go --addr=host:port --mode=log -alsologtostderr=true -v=4\n```\n\n### ssh mode\n```sh\ngo run websocket_client.go --addr=host:port --mode=ssh -alsologtostderr=true -v=4\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnevercase%2Fk8s-exec-pod","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnevercase%2Fk8s-exec-pod","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnevercase%2Fk8s-exec-pod/lists"}